--- title: donut.js date: 2025-10-15 --- this is my attempt to recreate [aikon's donut.c](https://www.a1k0n.net/2011/07/20/donut-math.html) animation on the web with obfuscated javascript. ```js (()=>{w=80;;h= 45;l=".,-~:;=!*#$@";A =B=0;setInterval(_=>{s =( document.getElementById("d")); if(!s)return;z=[];b=[];A+=.07;B+= .03;cA=Math.cos(A);sA=Math.sin(A);cB= Math.cos(B);sB=Math.sin(B);for(j=0;j< 6.28;j+=.07){cT=Math.cos(j);sT=Math.sin (j);for(i=0;i<6.2 ;i+=.02){sP=Math .sin(i);cP=Math. cos(i);H=cT+2;I =1/(sP*H*sA+sT* cA+5);;t=sP*H* cA-sT*sA;;x=w/2+ w*.375*I*(cP*H* cB-t*sB)|0;;;;y=h /2+h*.35*I*(cP*H *sB+t*cB)|0;if(x>=0&&x=0&&y(z[o=x+w*y]||0)){N=8*((sT*sA-sP*cT*cA )*cB-sP*cT*sA-sT*cA-cP*cT*sB)|0;z[o] =I;b[o]=l[N<0?0:N]}}}for(o="",k=0 ;k (loading donut...) ::: try 'debug mode' below