<!--
.. title: Return of the cocked-up cycloid
.. slug: return-of-the-cocked-up-cycloid
.. date: 2007-06-06 22:30:08
.. type: text
.. category: blog
-->

A couple of years ago, I taught myself some rudimentary PostScript programming from Bill Casselman's brilliant
[Mathematical Illustrations book](http://www.math.ubc.ca/~cass/graphics/manual/). PostScript is excellent fun, and I
thoroughly recommend it to all weirdos with an interest in stack-based graphics programming.

Recently, while fiddling with [MetaPost](http://en.wikipedia.org/Metapost) (another perverse but entertaining graphics
language), I remembered using Python and PostScript to create a nice Bezier curve approximation to a cycloid. This was
before I discovered [PyX](http://pyx.sf.net), which does that sort of thing for you, and it's a very illustrative
exercise - but my not-quite-right first attempt actually produced a fascinating and very pretty result:

![My cocked-up cycloid](/images/bezier-curve.png)

<!-- For those who'd like to look at the PostScript source or who just like zooming in arbitrarily far into vector images,
[here's the PostScript version](/bezier-curve.ps). -->

While the code that produced it is long gone, I'm happy to still have the result. Only mathematical illustrations can
produce such satisfying errors... and just imagine what someone talented and artistic could do with the right
mathematical/programming knowledge.
