Saturday, November 04, 2006

More Pythonic Mathematics

:: protocols ::
Today we dove into tcp/ip and the smoke signals that ride atop it: nntp, ftp, http... smtp.

Gnubees often say "the Internet" meaning just http (hypertext transfer protocol), the one used to serve web pages (through port 80 most likely), but long before Mosaic, Netscape, IE, Opera, Mozilla... FireFox, we had usenet (the newsgroups) and ways to swap files (ftp = file transfer protocol) -- and of course email.

All of these services working together define the Internet, not just http and its webwork of interconnected urls.

After this short intro, we watched Warriors of the Net, a mathcast I've used ever since my first Saturday Academy class at West Precinct.


:: mosaic ::
Then it was back to VPython and the challenge of connecting the dots in XYZ to make shapes, starting with the simplest, the simplex or tetrahedron.

This time we had stickworks.py with its Vector and Edge to aid and abet, and a few students had additional shapes in short order.

My Pythonic vectors always have their tail at the origin. If you want a line segment between any two points, feed those two vectors to the Edge class to get back your edge object, which displays in the VPython window when you trigger its draw method.

:: vector arithmetic ::
In preparation for Vpython sculpting, we went over some basic geometry using models made years ago in collaboration R. Z. Chu and Trevor. They're a bit rough around the edges but still usable, though the Vector Flexor broke a joint during my Wanderers presentation on Halloween, and the rhombic triacontahedron (see it?), scaled to volume 5, is definitely falling apart.

I pour these hard white beans from one shape to the other, reminding them of our everyday home base sculpture.

:: cargo cult geometry ::
I had a parent sitting through much of this class, even asking questions. That's new for Saturday Academy, but worth testing. Clearly some of these students are working with their parents at home on Python + VPython, even though we don't assign homework. I also learned one of the parents is a fellow alum, Princeton '83 (just three years behind me). We chatted about some of the class reunions we'd attended.

Next week: we plan to get more into animation, getting beyond static imagery. One of my students is interested in coding a planets-around-the-sun type toon. I turned him on to Celestia.