import pygame as p
import math
p.init()
WIDTH, HEIGHT = 800, 800
s = p.display.set_mode((WIDTH, HEIGHT))
p.display.set_caption("Polar Spiral")
clock = p.time.Clock()
cx, cy = WIDTH // 2, HEIGHT // 2
t = 0
running = True
while running:
    for event in p.event.get():
        if event.type == p.QUIT:
            running = False
    s.fill((0, 0, 0))
    for i in range(360):
        angle = math.radians(i + t)
        radius = i * 2
        x = cx + radius * math.cos(angle)
        y = cy + radius * math.sin(angle)
        color = ((i + t * 2) % 256, (i * 2) % 256, 200)
        p.draw.circle(s, color, tuple(map(int, [x, y])), 2)
    p.display.flip()
    t += 1
    clock.tick(60)
p.quit()

