JS Sketch

Copy any one of the following code snippets into the text box at the bottom of the page and hit submit.
Additionally you can edit snippets or create your own from scratch...

Spiral:
END = Math.PI * 12;
radius = 200;
inc = 0;
for (i = 0; i < END; i+=0.1){
  colors[inc] = 0xFFFFFF;
  plot[inc++] = radius * Math.cos(i);
  plot[inc++] = radius * Math.sin(i);
  radius-=.5;
}

Parabola:
// y = x^2, x=[-5, 5]
x = -5;
y = 0;
scale = 6;
for (i = 0; x<=5; i+=2){
  y = x * x;
  x++;
  plot[i] = x * scale;
  plot[i + 1] = y * -scale;
}

3D Shape:
TWO_PI=Math.PI*2; rotX=65; rotY=20; inc=0;
cosx=Math.cos(rotX);
cosy=Math.cos(rotY);
sinx=Math.sin(rotX);
siny=Math.sin(rotY);
for (a =0; a < TWO_PI; a+=.08) {
	for (b =0; b < TWO_PI; b+=.07) {
		px=100*Math.cos(a)*Math.cos(b)*Math.cos(b);
		py=100*Math.sin(a)*Math.cos(b);
		pz=100*Math.sin(b);
		zpos=pz*cosx-px*sinx;
		xpos=pz*sinx+px*cosx;
		ypos=py*cosy-zpos*siny;
		zpos=py*siny+zpos*cosy;
		depth = 1/((zpos/120)+1);
		colors[inc] = inc << 16;
		plot[inc++] = (xpos * depth);
		plot[inc++] = (ypos * depth);
	}
}