stdmap.py

Created by gianfranco-oddenino

Created on March 17, 2024

293 Bytes

The script draws 10^6 points of the standard map, an area-preserving chaotic map from a square with side 2π onto itself. It is constructed by a Poincaré’s surface of section of the kicked rotator, and is defined by:
p[n+1]=p[n]+k*sin(θ[n])
θ[n+1]=θ[n]+p[n+1]


from math import *
from kandinsky import *

def draw(k=1.5):  
  p2=2*pi
  x=0.01; y=0.01
  for i in range(1000000):
    xi,yi=round(x*160/pi),round(y*111/pi)
    c=get_pixel(xi,yi)[0]-8
    if c<0:
      c=0
    set_pixel(xi,yi,color(c,c,c))
    y=(y+k*sin(x))%p2
    x=(x+y)%p2

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.