Initial data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 72d218235f
commit f23f22d71c
199087 changed files with 3378941 additions and 0 deletions

View file

@ -0,0 +1,19 @@
fcn pythagorasTree{
bitmap:=PPM(640,640,0xFF|FF|FF); // White background
fcn(bitmap, ax,ay, bx,by, depth=0){
if(depth>10) return();
dx,dy:=bx-ax, ay-by;
x3,y3:=bx-dy, by-dx;
x4,y4:=ax-dy, ay-dx;
x5,y5:=x4 + (dx - dy)/2, y4 - (dx + dy)/2;
bitmap.cross(x3,y3);bitmap.cross(x4,y4);bitmap.cross(x5,y5);
bitmap.line(ax,ay, bx,by, 0); bitmap.line(bx,by, x3,y3, 0);
bitmap.line(x3,y3, x4,y4, 0); bitmap.line(x4,y4, ax,ay, 0);
self.fcn(bitmap,x4,y4, x5,y5, depth+1);
self.fcn(bitmap,x5,y5, x3,y3, depth+1);
}(bitmap,275,500, 375,500);
bitmap.writeJPGFile("pythagorasTree.jpg",True);
}();