Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/local/bin/python2.7
- import pygame
- import math
- pygame.init()
- Width = 1920 - 2
- Height = 1080 - 24
- mid_x = Width / 2
- mid_y = Height / 2
- radius = min(mid_x,mid_y)
- Black = (0,0,0)
- White = (255,255,255)
- Green = (0,255,0)
- screen = pygame.display.set_mode((Width, Height))
- screen.fill(White)
- pygame.draw.line(screen, Black, (mid_x, 0), (mid_x, Height))
- pygame.draw.line(screen, Black, (0, mid_y), (Width, mid_y))
- pygame.display.update()
- for angle in range(0,360):
- phi = math.radians(angle)
- x = math.sin(phi)
- y = math.cos(phi)
- xx = mid_x + (x * radius)
- yy = mid_y - (y * radius)
- pygame.draw.line(screen, Green, (mid_x, mid_y), (xx, yy))
- pygame.display.update()
- while 1:
- event = pygame.event.poll()
- if event.type == pygame.MOUSEBUTTONDOWN:
- pygame.quit()
- sys.exit()
Add Comment
Please, Sign In to add comment