Lissajous I

Rupert Russell

Ballarat, Australia

  • Available
    Products
    41
  • Artist
    Notes

Apparel

Cases & Skins

Wall Art

Home Decor

Accessories

Stationery

Artist's Description

Created with Processing:

// Draws a Lissajous figures
// Based on code by Javier Romero
// http://www.fjromero.com/processing/lissajous/

// 27 March 2011
// http://www.rupert.id.au/tutorials/processing/ex...

int screen_width = 2400;
int screen_height = 3200;

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

/* Try different values for a & b */
// eg a=1, b=3; a=1, b=2; a = 3, b = 4; a=9, b=8;

float a = 1.7;
float b = 1.8;
float delta = PI/2;

float x, y;
float t=10;
float inc_t = 0.01;

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

void draw(){
// background(0);
x = AX*sin(a*t + delta) + screen_width/2;
y = BX*sin(b*t) + screen_height/2;

fill(#ffff00);
ellipse(x,y,20,20);

t = t+inc_t;
}

// Save tif when mouse is clicked
void mouseClicked(){
// noLoop();
save(“lissa_9.tif”);
}

All Products Tags

processing lissajous curve maths yellow

desktop tablet-landscape content-width tablet-portrait workstream-4-across phone-landscape phone-portrait
desktop tablet-landscape content-width tablet-portrait workstream-4-across phone-landscape phone-portrait