/* built with Studio Sketchpad:
* https://sketchpad.cc
*
* observe the evolution of this sketch:
* https://studio.sketchpad.cc/sp/pad/view/ro.IuD7$D8aC7U/rev.1207
*
* authors:
* Matt Perkins
* license (unless otherwise specified):
* creative commons attribution-share alike 3.0 license.
* https://creativecommons.org/licenses/by-sa/3.0/
*/
// Pressing Control-R will render this sketch.
int i = 0;
int width2 = 0;
int height2 = 0;
int skew = 0;
int LINES = 1;
void setup() { // this is run once.
// set the background color
background(255);
// canvas size (Variable aren't evaluated. Integers only, please.)
size(800, 300);
// smooth edges
smooth();
// limit the number of frames per second
frameRate(30);
width2 = width/2;
height2 = height/2;
background(0, 0, 0, 255);
// set the width of the line.
strokeWeight(1);
}
void draw() { // this is run repeatedly.
// draw the line
for(int j=0; j<(LINES+skew); j++) {
strokeWeight(1);
stroke(255, j, j, 16);
int x = (width2 + 128) * cos((j/(LINES+skew)) * TWO_PI) + width2;
int y = (height2 + 128) * sin((j/(LINES+skew)) * TWO_PI) + height2;
line(width2,height2,x,y);
}
// move over a pixel
if (i < LINES) {
i++;
} else {
i = 0;
}
skew = (skew + 1) % 360;
}