Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,20 @@
fcn mandelbrot{ // lord this is slooooow
bitmap:=PPM(640,480);
foreach y,x in ([0..479],[0..639]){
cx:=(x.toFloat()/640 - 0.5)*4.0; //range: -2.0 to +2.0
cy:=((y-240).toFloat()/240.0)*1.5; //range: -1.5 to +1.5
cnt:=0; zx:=0.0; zy:=0.0;
do(1000){
if(zx*zx + zy*zy > 2.0){ //z heads toward infinity
//set color of pixel to rate it approaches infinity
bitmap[x,y]=cnt.shiftLeft(21) + cnt.shiftLeft(10) + cnt*8;
break;
}
temp:=zx*zy;
zx=zx*zx - zy*zy + cx; //calculate next iteration of z
zy=2.0*temp + cy;
cnt+=1;
}
}
bitmap.write(File("foo.ppm","wb"));
}();