Monday, April 11, 2016

Pasta Parametrization, High Resolution

Integrating (ha ha) Nested Tori back into life (of course I'm doing a lot of integrating, if I'm teaching, anyway). Lots of change was (and is) afoot.

Anyway, instead of continually getting peeved with Apple for not ever fixing any bugs in Grapher for over 10 years (a job that I would gladly take the mantle on, by the way: anyone at Apple listening??), I took matters into my own hands and started experimenting with some open source plotting libraries. In particular, I've taken somewhat of a liking for matplotlib, a famous Python package. The boon is, it can generate pdf files properly (unlike Grapher, which basically puts the bitmap into a pdf file and adds the extension .pdf, but when you zoom in, it's blocky and clearly still a bitmap). Honestly, though, it is in fact a lot more work (which was mitigated somewhat by defining some functions).

Here are the results for plotting the Pasta Parametrization in matplotlib (specifically, the mplot3d toolkit):


Of course, I should probably figure out how to control the lighting better: it doesn't look as good as Grapher's (at a scale for which the resolution issue is not a problem). And here are the matching formulas (at a larger size than the old version):


Happy parametrizing! (see here for the answer key, and here for the Python source)
(Astute readers may notice that the above images are actually still bitmaps... but that's an artifact of the blogging software, which does not natively display pdf's ... see here for the pdf for that)

No comments:

Post a Comment