Lissajous XII by Rupert  Russell

T-Shirts & Hoodies

Clothing Style:
or
$25.52
Available to buy on…


// Created with Processing
// Draws a Lissajous figures
// 2 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 = 8;
float b = 2;
float x1;
float y1;
float x2;
float y2;

int counter = 0;
int saveCounter = 0;
String file_name;

void setup(){
smooth();
fill(255);
strokeWeight(5);
size(screen_width, screen_height);
}

// Based on Microworlds LOGO code from http://www.mathcats.com/gallery/15wordcontest.html
// repeat 360 [setxy (sin(2 * repcount)) * 150 (sin(3 * repcount)) * 150]

void draw(){
fill(#000000);

// Find 2 points and draw a line between themx1 = (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);saveCounter = saveCounter + 1;if (saveCounter == 365) {String file_name = “Lissajou_a=” + str(a) + “_b=” + str(b);save(file_name);noLoop();}

}

T-Shirts & Hoodies

processing, lissajous, maths, linear

All Products

processing, lissajous, maths, linear

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

10%off for joining

the Redbubble mailing list

Receive exclusive deals and awesome artist news and content right to your inbox. Free for your convenience.