Advertisement
Geometrian

Untitled

Oct 15th, 2014
584
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.71 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_circ = pygame.Surface((100,100))
  6. pygame.draw.circle(surf_circ,(0,30,30),(50,50),50)
  7. radius=40.0
  8. for N in range(2,12+1,1):
  9.     surf_scrn.fill((255,255,255))
  10.     for i in range(N):
  11.         theta=float(i)/N*pi*2.0; px,py=radius*cos(theta),radius*sin(theta)
  12.         surf_scrn.blit(surf_circ,(100+px-50,100+py-50),special_flags=BLEND_RGB_SUB)
  13.     for i in range(N):
  14.         theta=float(i)/N*pi*2.0; px,py=radius*cos(theta),radius*sin(theta)
  15.         pygame.draw.circle(surf_scrn,(0,0,255),(int(100+px+0.5),int(100+py+0.5)),5)
  16.     pygame.image.save(surf_scrn,"output/"+str(N)+".png")
  17. input()
  18. pygame.quit()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement