This commit is contained in:
Michael S. 2024-01-21 17:57:58 +01:00
commit 41d7bb6830
2 changed files with 39 additions and 0 deletions

31
main copy.py Normal file
View file

@ -0,0 +1,31 @@
#!/usr/bin/python3
from math import sin,cos
import pygame
def berechne_dreieck(alpha,c):
a = cos(alpha)*c# x
b = sin(alpha)*c# y
return a,b
pygame.init()
clock = pygame.time.Clock()
screen = pygame.display.set_mode([500,500])
screensize = pygame.display.get_window_size()
running = True
if __name__ == "__main__":
while running:
for event in pygame.event.get():
if event.type == pygame.QUIT:
exit()
a,b = berechne_dreieck(45,100)
# draw a
pygame.draw.line(screen,(255,0,0),(screensize[0]-10,screensize[1]-10),(0,0))
# draw b
pygame.draw.line(screen,(255,0,0),(screensize[0]-10,screensize[1]-10),(0,0))
pygame.display.flip()
clock.tick(60)
print(berechne_dreieck(45,100))

8
main.py Normal file
View file

@ -0,0 +1,8 @@
#!/usr/bin/python3
from math import sin,cos
def berechne_dreieck(alpha,c):
a = cos(alpha)*c# x
b = sin(alpha)*c# y
return a,b
print(berechne_dreieck(45,100))