[Edu-sig] superformula, generators

Gregor Lingl gregor.lingl at aon.at
Sat May 21 23:11:17 CEST 2011


Hi all,

recently I stumbled (once more) over a posting by our friend
Daniel Ajoy about the superformula (I think it was in a Logo-Forum):

http://en.wikipedia.org/wiki/Superformula

On the other side Kirby wrote interesting suggestions
about using generators.

Now, weekend, bad weather, some sparetime, I
assembled an implementation of a superformula-viewer
using pygame. It runs with Python 2.6 or higher, also
3.x, of course

You'll find it here for download:

http://dl.dropbox.com/u/2016850/superformula.py

or appended (which sometimes / for some of you)
doesn't work well depending on the browser or whatever.

The script uses generators for generating the pointlists
of the graph of the superformula and also for generating
colors for the segments of the graph-area.

Morover I've prepared a q&d slider class, which possibly
doesn't use the canonical way of processing events in
pygame but works fine for this application.

Critical comments and feedback and also questions, of course,
are welcome.

Perhaps someone is willing to amend the docstrings,
which suffer from my clumsy English and could well
be more clear.

Amendments of the code, espercially ones, which make it
more readable and easier to understand, also.

Useful for classroom use? Perhaps to difficult?

Best regards,
Gregor


-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: superformula.py
URL: <http://mail.python.org/pipermail/edu-sig/attachments/20110521/cde14bc5/attachment.ksh>


More information about the Edu-sig mailing list