Saturday, January 23, 2021

Chaotic Maps in Processing 3, The Knot Map

The pattern is generated with the following code:

//Initial values
float x = 0.125;
float y = - x;
void setup() {
  frameRate(60);
  size(800,600);
  colorMode(RGB, 255, 255, 255);
  background(0);
  stroke(255, 255, 255);
  strokeWeight(0.125);
}
void draw() {
  float dx = - y;
  float dy = pow(x, 3) - x - y;
  x = dx;
  y = dy;
  translate(width / 2, height / 2);
  point(x * 128, y * 128);
}

It creates the following image:


 

No comments:

Post a Comment