Advertisement
Geometrian

Untitled

Oct 15th, 2014
616
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.65 KB | None | 0 0
  1. import pygame
  2. from pygame.locals import *
  3. from math import *
  4. surf_scrn = pygame.display.set_mode((200,200))
  5. surf_scrn.fill((255,255,255))
  6. surf_circ = pygame.Surface((100,100))
  7. pygame.draw.circle(surf_circ,(0,30,30),(50,50),50)
  8. N=12; radius=40.0
  9. for i in range(N):
  10.     theta=float(i)/N*pi*2.0; px,py=radius*cos(theta),radius*sin(theta)
  11.     surf_scrn.blit(surf_circ,(100+px-50,100+py-50),special_flags=BLEND_RGB_SUB)
  12. for i in range(N):
  13.     theta=float(i)/N*pi*2.0; px,py=radius*cos(theta),radius*sin(theta)
  14.     pygame.draw.circle(surf_scrn,(0,0,255),(int(100+px+0.5),int(100+py+0.5)),5)
  15. pygame.image.save()
  16. pygame.display.flip()
  17. input()
  18. pygame.quit()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement