From bc77e0617fb3bff056a80e2531bed720be9d04c7 Mon Sep 17 00:00:00 2001 From: Megamichi Date: Sun, 21 Jan 2024 19:57:30 +0100 Subject: [PATCH] =?UTF-8?q?bogema=C3=9F=20war=20das=20problem?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main copy.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/main copy.py b/main copy.py index 9266cab..d8b2bba 100644 --- a/main copy.py +++ b/main copy.py @@ -1,10 +1,11 @@ #!/usr/bin/python3 -from math import sin,cos +from math import sin,cos,radians from time import sleep import pygame def berechne_dreieck(alpha,c): + alpha = radians(alpha) a = cos(alpha)*c# x - b = sin(alpha)*c# y + b = -sin(alpha)*c# y return a,b def get_debug_text(): @@ -49,16 +50,16 @@ if __name__ == "__main__": screen.fill((0,0,0)) if winkel >= 360 or winkel <= -1: winkel = 0 - a,b = berechne_dreieck(winkel,150) + a,b = berechne_dreieck(winkel,200)#screensize[0]*screensize[1]) end_pos = start_pos[0]+a,start_pos[1]+b # draw c schwarz - pygame.draw.line(screen,(0,0,0),start_pos,end_pos) + pygame.draw.line(screen,(0,0,0),start_pos,end_pos,3) # draw a rot - pygame.draw.line(screen,(255,0,0),start_pos,(start_pos[0]+a,start_pos[1])) + pygame.draw.line(screen,(255,0,0),start_pos,(start_pos[0]+a,start_pos[1]),3) # draw b blau - pygame.draw.line(screen,(0,0,255),(start_pos[0]+a,start_pos[1]),(start_pos[0]+a,start_pos[1]+b)) + pygame.draw.line(screen,(0,0,255),(start_pos[0]+a,start_pos[1]),(start_pos[0]+a,start_pos[1]+b),3) get_debug_text() pygame.display.flip()