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,21 @@
var [const] M=50.0;
fcn cuboid(w,h,z){
w*=M; h*=M; z*=M; // relative to abs dimensions
bitmap:=PPM(400,400);
clr:=0xff0000; // red facing rectangle
bitmap.line(0,0, w,0, clr); bitmap.line(0,0, 0,h, clr);
bitmap.line(0,h, w,h, clr); bitmap.line(w,0, w,h, clr);
r,a:=(w+z).toFloat().toPolar(0); // relative to the origin
a,b:=r.toRectangular((30.0).toRad() + a).apply("toInt"); c:=a; d:=b+h;
clr=0xff; // blue right side of cuboid
bitmap.line(w,0, a,b, clr); bitmap.line(a,b, c,d, clr);
bitmap.line(w,h, c,d, clr);
e:=c-w;
clr=0xfff00; // green top of cuboid
bitmap.line(0,h, e,d, clr); bitmap.line(c,d, e,d, clr);
bitmap.write(File("foo.ppm","wb"));
}(2,3,4);