// globals Graviton gravioli; void setup(){ size(200,200); background(0); gravioli = new Graviton(100,100); } void draw(){ background(0); gravioli.draw(); } class Graviton{ float x, y; float cnt, detail, radius, offset; // constructor Graviton(float xpos, float ypos){ x = xpos; y = ypos; radius = width * 0.4; offset = width / 2; detail = 6.28 / 10000; cnt = random(-3.14, 3.14); } // called every refresh from main draw loop void draw(){ this.move(); stroke(255); point(x,y); } void move(){ x = sin(cnt) * radius + offset; y = cos(cnt) * radius + offset; cnt = cnt + detail; if (cnt > 3.14){ cnt = -3.14; } } }