From 41d7bb68302d892091a1d247ffe212e25aefac19 Mon Sep 17 00:00:00 2001 From: Megamichi Date: Sun, 21 Jan 2024 17:57:58 +0100 Subject: [PATCH] init --- main copy.py | 31 +++++++++++++++++++++++++++++++ main.py | 8 ++++++++ 2 files changed, 39 insertions(+) create mode 100644 main copy.py create mode 100644 main.py diff --git a/main copy.py b/main copy.py new file mode 100644 index 0000000..f151ae3 --- /dev/null +++ b/main copy.py @@ -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)) \ No newline at end of file diff --git a/main.py b/main.py new file mode 100644 index 0000000..6ccd37d --- /dev/null +++ b/main.py @@ -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)) \ No newline at end of file