Lissajous XXII by Rupert  Russell

T-Shirts & Hoodies

Clothing Style:
or
$25.52
Available to buy on…


// Created with Processing
// Draws a Lissajous figures
// 3 April 2011
// Examples

int screen_width = 2000;
int screen_height = 2000;

/* Scale image and reduce by 5 pixels to remove from edge of screen */
int AX = (screen_width / 2) – 5;
int BX = (screen_height / 2) – 5;

float a = 4;
float b = 6;
float x1, y1, x2, y2;

int counter = 0;
int saveCounter = 0;
String file_name;
//
void setup(){
smooth();
fill(255);
strokeWeight(2);
size(screen_width, screen_height);
}
//
void draw(){
fill(#000000);
//
x1 = (sin(a * counter) * AX) + screen_width / 2;
//
y1 = (sin(b * counter) * BX) + screen_height / 2;
//
counter = counter + 1;
x2 = (sin(a * counter) * AX) + screen_width / 2;
//
y2 = (sin(b * counter) * BX) + screen_height / 2;
line(x1,y1,x2,y2);
ellipse((sin(a * counter) * AX) + screen_width / 2 , (sin(b * counter) * BX) + screen_height / 2, 10, 10);

//saveCounter = saveCounter + 1;if (saveCounter == 365) {String file_name = “Lissajou_a=” + str(a) + “_b=” + str(b);save(file_name);noLoop();}

}

My current project is to maser Bzier Curves in processing

View Full Profile
desktop tablet-landscape content-width tablet-portrait workstream-4-across phone-landscape phone-portrait