Skip to content

Instantly share code, notes, and snippets.

@jeffnoko
Created March 22, 2018 23:34
Show Gist options
  • Save jeffnoko/64350345442bbdc6653739a3659b68b6 to your computer and use it in GitHub Desktop.
Save jeffnoko/64350345442bbdc6653739a3659b68b6 to your computer and use it in GitHub Desktop.
import processing.serial.*;
Serial myPort;
int counter = 0;
float x, y, t;
int count = 0;
float c = 4;
float a = 200;
float b = 400;
float h = 500;
float k = 500;
void setup() {
size(1000, 1000);
strokeWeight(5);
stroke(0);
smooth();
background(0);
}
void draw() {
if (count ==64) {
c +=.1;
a = 200;
b = 400;
k += 20;
count = 0;
}
t += .1;
x = a*cos(t)*cos(c)-b*sin(t)*sin(c)+h;
y = a*cos(t)*sin(c)+b*sin(t)*cos(c)+k;
stroke(255);
ellipse(x, y, 10, 10);
println(count);
count++;
a -=.5;
b -=.5;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment