init
This commit is contained in:
commit
41d7bb6830
2 changed files with 39 additions and 0 deletions
31
main copy.py
Normal file
31
main copy.py
Normal 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
8
main.py
Normal 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))
|
Loading…
Reference in a new issue