Archive for November, 2007

Nov 14 2007

Pyglet Great, Math Hard

Published by Chris McAvoy under Blog, Python, BeeSim

I’ve blogged about my random obsession with bees in the past. The release of Pyglet encouraged me to pick it up again and try to make a bee-system associated with coordinates rather than with abstract “locations.”

Over the weekend, I started to write a trig library that could compute angles and distances, so I could move my bees around a grid. It turns out, I’m pretty bad at math. Brant Harris sat down and explained Vectors to me in about 15 minutes. I immediately ditched my trig library, and built a basic Vector bee demo in a half hour or so last night. The code for it is in my expansive public-works repository. In that same module is trig.py, which is the start of the trig library I ended up ditching. The Vector work was already written in PyEuclid, the very excellent Euclidian Geometry library written especially for Pygame development.

The code, suitable for cutting and pasting, is as follows:

2 responses so far

Nov 13 2007

Pycon 2008 Proposals Due Friday

Published by Chris McAvoy under Python, pycon2008

http://us.pycon.org/2008/conference/proposals/

Just a heads up.

I think this will be the first year I actually propose a talk.

No responses yet