Skip to content

Instantly share code, notes, and snippets.

@disser2
Created April 1, 2013 10:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save disser2/5284261 to your computer and use it in GitHub Desktop.
Save disser2/5284261 to your computer and use it in GitHub Desktop.
void setup() {
size(900, 900);
smooth();
}
//start parameter
float t = 0;
//density of two lines
float density = 0.05;
//width of drawing
float a = 0.3;
void draw() {
noStroke();
fill(255, 0);
rect(0, 0, width, height);
t = t + density;
a = a + density/100;
float x = (a*sqrt(2)*cos(t))/(sq(sin(t))+1);
float y = (a*sqrt(2)*cos(t)*sin(t))/(sq(sin(t))+1);
float x2 = (a*sqrt(2)*cos(t+density))/(sq(sin(t+density))+1+0.2);
float y2 = (a*sqrt(2)*cos(t+density)*sin(t+density))/(sq(sin(t+density))+1);
strokeWeight(1);
stroke(1);
line(x*300+450,y*300+450,x2*300+450,y2*300+450);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment