from math import * from kandinsky import * fill_rect(0,0,320,222,(0,0,0)) coul = (255,70,190), (255,16,22), (110,70,70),(140,200,80), (120,70,30),(10,0,0) dr, width, height = 1/57.3, 320, 220 xc, yc = width / 2, height / 2 h2 = pi / 2 k2 = 2 k3 = 4 k5 = 0.25 k6 = 8 k8 = 8 ra = 150 u = 1 z = 0 p = 0 rScale = ra while rScale > -1: a = 0 while a < 360: t = a * dr if (70 > a > 20) or (160 > a > 110) or (250 > a > 200) or (340 > a > 290): p1 = abs(cos(k3 * t)) + k2 * (k5 - abs(cos(k3 * t + h2))) p2 = k2 + k8 * abs(cos(k6 * t + h2)) r = rScale * (u + p1 / p2) x2 = int(xc + r * cos(t)) y2 = int(yc - r * sin(t)) c = coul[int((ra - rScale)//10 % 6)] set_pixel(x2, y2, c) else: r = .7 * rScale * (1 + cos(4 * t)) x2 = int(xc + r * cos(t)) y2 = int(yc - r * sin(t)) c = coul[int((ra - rScale)//10 % 6)] set_pixel(x2, y2, c) a += .2 rScale -= .5