Created
April 1, 2013 10:50
-
-
Save disser2/5284261 to your computer and use it in GitHub Desktop.
Kind of like this: http://en.wikipedia.org/wiki/Lemniscate_of_Bernoulli
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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