Explore the Mandelbrot set with your mouse. Double click to toggle the corrupted X fractal. Zoom with the mouse wheel and change the iteration with 'Enter' and 'Space'
for(_='D(G)}FF,a.onmouse`=1,G`_.m(l)^^.a(k]==T[[||10Zl.f()=~~(i&&(or(wh){20d.E=st(fc.fillM.log(i*=n,d=>{(dTimeout,),*L)/(g*Lct(E.rvar =0,return ,500new C(this=()=>-=10*(L*movement,b.addEventListener("M=Math,L=.1,p=L,u=255,iw=7,ih=432,st=setct=clearXYg=150,RS=5;class C{constructor,e=d,.i=e}a+d,.i+Fm e=;e*d-e.i*,e*+*eFf( d=;M.sqrt*d+*F}D{a.width=ww*La.height=hh*L);f d=0;d<w;++d)f e=0;e<h;++efx2=-w/2+Xy2=(e-h/2+Yk=x2,y2l=0,0nv=4*+e*w);2>&&n<S;)l=i?l^^^]):l]++n;m=n==S?S:n-)Style="hsl("+(m-30)/+"rad,70%,"+(m<S?100*M.abs(m/40%2-1+0):0)+"%)",Rect,e,1,1F}eel",=eelDelta,n=0>(?:-deltaY)?.8:1.25,gXYL=p,GFf{L_down{L=p,R_move=RXXYYG)`up{RGF,ia.ondblclicki=!i,)keyup",T=keyCode,32Z9[?S-=:(13Z7[)S+=5>SS=5GF);';G=/[-Z-`FG]/.exec(_);)with(_.split(G))_=join(shift());eval(_)
Zm9yKF89J0QoRyl9RkYsYS5vbm1vdXNlYD0xLEdgXy5tKGwpXl4uYShrXT09VFtbfHwxMFpsLmYoKR89fn4oaR4mJigdb3IoHHdoGyl7GjIwGWQuGEU9c3QoZhdjLmZpbGwWTS5sb2coFRhpFCo9biwTZD0+exIoZBFUaW1lb3V0LBApLA8qTCkvKGcqTA8OY3QoRQ8MLnILdmFyIAk9MCwIcmV0dXJuIAcMFyw1MDAGbmV3IEMoBXRoaXMEPSgpPT4DLT0xMCooTCoYbW92ZW1lbnQCLGIuYWRkRXZlbnRMaXN0ZW5lcigiAU09TWF0aCxMPS4xLHA9TCx1PTI1NSxpdz03GSxpaD00MzIsc3Q9c2V0EGN0PWNsZWFyEFgIWQhnPTE1MCxSCFM9GTU7Y2xhc3MgQ3tjb25zdHJ1Y3RvchEsZRoECz1kLAQuaT1lfWERGgcFBAsrZAssBC5pKxRGbREaCWU9BDsHBWULKmQLLWUuaSoULGULKhQrFCplC0ZmKBoJZD0EOwdNLnNxcnQRCypkCysUKhRGfUQDe2Eud2lkdGg9dx53KkwPYS5oZWlnaHQ9aB5oKkwpO2YcCWQ9MDtkPHc7KytkKWYcCWU9MDtlPGg7KytlGmYceDI9ES13LzIrWA55Mj0oZS1oLzIrWQ5rPQV4Mix5Mg9sPQUwLDAPbgh2PTQqEStlKncpOzI+HyYmbjxTOylsPWk/bF5eXl0pOmxdDysrbjttPW49PVM/UzpuLRUVHykPFlN0eWxlPSJoc2woIisobS0zMCkvGSsicmFkLDcwJSwiKyhtPFM/MTAwKk0uYWJzKG0vNDAlMi0xKzApOjApKyIlKSIsFlJlY3QRLGUsMSwxRn0BG2VlbCIsEhs9GBtlZWxEZWx0YSxuPTA+KBs/GzotGGRlbHRhWSk/Ljg6MS4yNSxnE1gTWRNMPXAsRw8GRg9mA3tMX2Rvd24De0w9cCwMUl9tb3ZlPRJSHQxYAlgPWQJZD0cpYHVwA3sGD1IIR0YsaQhhLm9uZGJsY2xpY2sDaT0haSwXKQFrZXl1cCIsElQ9GGtleUNvZGUsMzJaOVs/Uy09GTooMTNaN1spHVMrPRkPNT5THVM9NQ9HRik7JztHPS9bAS0fWi1gRkddLy5leGVjKF8pOyl3aXRoKF8uc3BsaXQoRykpXz1qb2luKHNoaWZ0KCkpO2V2YWwoXyk=
M=Math;
B=.1;//size
p=B;
u=255;
iw=720;
ih=432;
st=setTimeout;
ct=clearTimeout;
X=0;//X slide
Y=0;//Y slide
Z=150;//zoom
R=0;
I=205;//max iterations
class C
{
constructor(r,i)
{
this.r = r;
this.i = i;
}
a(n)
{
return new C(this.r + n.r, this.i + n.i);
}
m(n)
{
var t = this;
return new C((t.r * n.r) - (t.i * n.i), (t.r * n.i) + (n.i * t.r));
}
f()
{
var t = this;
return M.sqrt(t.r*t.r + t.i*t.i)
}
}
D=()=>{
a.width = w = ~~(iw*B);
a.height = h = ~~(ih*B);
//cd=c.getImageData(0,0,w,h);
//q = cd.data;
for(var x=0;x<w;++x)for(var y=0;y<h;++y)
{
x2 = ((x - (w/2)) + (X*B)) / (Z*B);
y2 = ((y - (h/2)) + (Y*B)) / (Z*B);
k=new C(x2,y2);
z=new C(0,0);
n=0;
v = (x+y*w)*4;
while(z.f() < 2 && n < I)
{
z=j?(z.m(z).m(z).m(z).m(z)).a(k):z.m(z).a(k);
++n;
}
m=n==I?I:n - M.log(M.log(z.f()));
//m=~~(I-m)*20;
//m=~~(I-m)*20;
//c2=[m%u, (m%(2*u))/2-30, (m%(4*u))/4-60];
//c2=[m%u,m%u,m%u];
//c2=[M.sin(m)*u,M.cos(m)*u,M.cos(m+3)*u];
//c.fillStyle ='hsl(' + m / 20 + 'rad,70%,' + (m < I ? 45 : 0) + '%)';
c.fillStyle ='hsl(' + ((m-30) / 20) + 'rad,70%,' + (m < I ? M.abs((m/40)%2-1+0)*100 : 0) + '%)';
c.fillRect(x,y,1,1);
/*q[v] = m%2*u;
q[v+1] = m%(2*u)/2;
q[v+2] = m%(3*u)/3;
q[v+3] = u;*/
}
//c.putImageData(cd,0,0);
};
b.addEventListener('wheel',e=>{
wh = e.wheelDelta;
n = (wh ? wh : -e.deltaY)<0 ? .8 : 1.25;
Z *= n;
X *= n;
Y *= n;
B=p;
D();
ct(E);
E=st(f,500);
});
f=()=>{B=1;D()};
a.onmousedown=e=>{
B=p;
ct(E);
R=1;
D();
}
a.onmousemove=e=>
{
if(R) {
ct(E);
X -= B * e.movementX * 10;
Y -= B * e.movementY * 10;
D();
}
}
a.onmouseup=e=>{
ct(E);
E=st(f,500);
R=0;
D();
}
j=0;
a.ondblclick=e=>j=!j;
E=st(f);
b.addEventListener('keyup', e =>{
K=e.keyCode;
if (K == 32 || K == 109)I-=20;
else if (K == 13 || K == 107)I+=20;
if(I<5)I=5;
D();
});