Pro Python remarks to math ed folks (pointers)
Kirby Urner
urner at alumni.princeton.edu
Tue Aug 24 11:03:34 EDT 1999
"Darrell" <news at dorb.com> wrote:
>Installed your stuff and changed a few things to get it to work.
>Had to add this method too Vector.
> def display(self):
> print self.data
That's cool.
I've just been going:
from vector import Vector
v = Vector(quad=(1,0,0,0))
print v.data
(1.0, 0.0, 0.0, 0.0)
You have xyz=3-tuple, quad=4-tuple and polar=3-tuple as your
three input options. When you rotate, you go:
v.rotate((0,0,30)) # 30 degrees around Z axis
or
v.rotate((10,0,0,0)) # 10 degrees around the A axis
This 'quad' stuff (with 4-tuples) is the most unusual and
exotic and would stump any classroom math teacher for a few
minutes because it's unfamiliar and not taught as a normal
part of any curriculum. But that doesn't keep "quadrays"
from being useful and fun. The polyhedra I'm interested in
are very easily constructed using these non-traditional
basis vectors, to the 4 corners of a regular tetrahedron
from an origin at (0,0,0,0) -- tetrahedron's center.
Note that ps module has lots of test scripts and does the
importing it needs, i.e.
import ps
ps.testprog2()
will write out some files (either POVray, VRML or both).
>Also changed some of the hardcoded paths.
Yes, ps has some of those. Good point.
>Then installed a VRML viewer.
>I'm digging around for a POV viewer still.
www.povray.org is where to get Povray. It's really a rendering
process, computational in nature, not just viewing, i.e. all
the Python supplies is ASCII text, with Povray has to munch
and crunch (same with VRML of course).
>Wow, very cool.
>
Thanks for the positive feedback.
>I have a teenager who hates math, maybe this would be useful.
I sure think there's a lot of potential here, especially when
you feel fluent enough to start doing art projects with
polyhedra. My website has lots of Povray graphics I did
using this Python or earlier Java or Xbase incarnations of
this application.
Examples:
http://www.inetarena.com/~pdx4d/ocn/oop6.html
http://www.inetarena.com/~pdx4d/ocn/oop5.html
Animated GIFs: http://www.inetarena.com/~pdx4d/ocn/xtals101.html
Kirby
More information about the Python-list
mailing list