JS1K

#2: the original

Source for demo by Andreas Köberle.

(function(){function m(a){h=a.clientX||h;i=a.clientY||i;b.clearRect(0,0,c,c);a=h/d;for(var n=(j-a)/a,e=0,g=i/d,k,o,l=0;l<p;l++){x=(j-a)*Math.cos(g*e)+(a+100)*Math.cos(g*n*e)+d;y=(j-a)*Math.sin(g*e)-(a+100)*Math.sin(g*n*e)+d;e+=Math.PI*4/p;if(k){b.strokeStyle="hsl("+(q+l%85)+", 80%, 50%)";b.beginPath();b.moveTo(k,o);b.lineTo(x,y);b.closePath();b.stroke()}k=x;o=y}}var f=document.getElementById("c"),b=f.getContext("2d"),c=1E3,d=c/2,p=1E3,j=d-100,q=0,h,i;f.width=c;f.height=c;b.globalAlpha=0.4;f.onmousemove=
m;f.onclick=function(){q=Math.random()*256;m({})}})();