Экспериментально получил нужный эффект.)))
import pygame
import random
import math
pygame.init()
win = pygame.display.set_mode((500,500))
pygame.display.set_caption("")
run = True
while run:
for event in pygame.event.get():
if event.type == pygame.QUIT:
run = False
if event.type == pygame.KEYDOWN:
if event.key == pygame.K_RETURN:
pygame.image.save(win, "image.jpg")
for x in range(0,361):
if math.cos(x) == 0 or math.sin(x) == 0:
continue
x1 =250+ math.sin(x)/math.cos(x)*50
y1= 250- math.sin(x)/math.cos(x)*50
x2 =250+ math.sin(x)/math.cos(x)*50
y2= 250+ math.sin(x)/math.cos(x)*50
pygame.draw.circle(win, (255,255,255), (x1, y1), 25,1)
pygame.draw.circle(win, (255,255,255), (x2, y2), 25,1)
pygame.display.update()
pygame.quit()
|