horizon.py

Created by schraf

Created on March 08, 2025

247 Bytes

My YouTube channel : Python, NUMWORKS, JavaScript, Excel Macro (VBA, Office Script)


from kandinsky import set_pixel
from math import sqrt
w,h = 600,416
for i in range(w):
 for j in range(h):
  x,y=i/w,j/h
  try:g=min(255,int(30/abs(sqrt((7*x-2)**2+(7*y-2)**2)-1+.005/(x-y))))
  except:g=0
  set_pixel(i,222-j,(g,)*3)

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 cookies policy.