archipel.py

Created by schraf

Created on August 07, 2022

599 Bytes


from kandinsky import *
from math import sin, cos, pi
from random import randint

COUL = [(37, 101, 174),(60, 153, 220),(102, 211, 250),(213, 243, 254)]
fill_rect(0,0,320,222,COUL[0])

A = pi * .3 # Testez autres valeurs que .3
C,S = cos(A), sin(A)
for i in range(100):
  rvb = COUL[randint(1,3)]
  r = 8 * randint(0, 355)/1e3
  phi = 2 * pi * randint(0, 1000)/1e3
  x = r * cos(phi)
  y = r * sin(phi)
  for j in range(1000):
    xn = C * x - S * y - S * sin(x)
    yn = S * x + C * y + C * sin(x)
    x, y = xn, yn
    set_pixel(int(160 + 320 * x / 10),int(110 + 256 * y / 10),rvb)

During your visit to our site, NumWorks needs to install "cookies" or use other technologies to collect data about you in order to:

With the exception of Cookies essential to the operation of the site, NumWorks leaves you the choice: you can accept Cookies for audience measurement by clicking on the "Accept and continue" button, or refuse these Cookies by clicking on the "Continue without accepting" button or by continuing your browsing. You can update your choice at any time by clicking on the link "Manage my cookies" at the bottom of the page. For more information, please consult our <a href="https://www.numworks.com/legal/cookies-policy/">cookies policy</a>.