Spiro Drawing |
||
|
This is a demonstration of the Super Spirograph toy. Select one of the stock drawings from the drop-down at the upper left. The code for the drawing is shown to the right. If you wish to see or edit the code for all the drawings, click the Code button at the upper right. Unless your browser blocks pop-up windows, the Code window will open. If you edit the code, press the Update button to update the main window. The code is written in its own language. Implementation DetailsThis Javascript program was originally written in C around 1982. It ran on a monochrome vector display, four-pen plotter, then PC monitors: CGA, VGA, etc. The program was another integer-math tour de force, for machines without floating point. Since then, Javascript is floating-point by default and only supports integers for binary operations. This program's conversion to Javascript maintains the original integer operations, at the price of ugly syntax. The integer math performs trigonometry with CORDIC functions. Source files: spiro.js, parse.js, semantic.js, limit.js, exec.js, plot.js, trig.js, book.js. |
||