Calculate Moon Phase Data with PHP II

A little while ago I posted the code to a PHP-based moon phase calculation program, which was a translation of the Perl Astro::MoonPhase module. This application can calculate the phase of the moon for a particular date or set of dates, and is much more accurate than other PHP-based moon phase calculation programs I've seen.

Thanks to Alexander Cicovic, I noticed a silly error in the phasehunt() function that caused it to loop infinitely :-/ While I was digging into the code, I decided to also add the phaselist() function that was added to the latest Astro::MoonPhase module, version 0.60.

The moonphase.inc.php script can be easily include()'ed into your PHP apps. Also for bonus points I updated the moonphase.php sample script to include an example all three functions (phase, phaselist and phasehunt). So, here they are below:

moonphase.inc.php -- Moonphase Functions
moonphase.php -- Sample Code

Enjoy!

Update: This script is now available as a PHP class.


Model Rocketry Awesomeness

The Build

I've recently re-discovered an old hobby of mine; model rocketry! On a whim, a buddy of mine (John Kew) purchased a couple model rockets from a local hobby store. I purchased a rocket called the Big Daddy, which is a rather large rocket that accepts D and E sized engines. John went with a multi-stage rocket that, although was probably more technically advanced, was not nearly as totally sweet and awesome as the one I chose.

Anyway, the build was rather trivial. A little hot-glue and an hour or so and it was all together. Here's what the finished product looked like:


Instead of just purchasing a typical launch controller and launch pad, John and I decided to have a build-off. I built a totally cool looking detonater... uh, I mean, model rocket igniter thingy. It's a pretty simple device. Just a single circuit with a cutoff switch, and some wires to connect to the igniter on the rocket engine.





John built a pretty awesome launcher as well. Instead of a spiffy custom case he used a lamp cord, a wall socket, a light switch and a Staples Easy Button. I'll try to get some pictures of that formidable contraption posted a bit later.


The Launch

Unfortunately, I don't have any photos of the launches. John's wife Sarah took a few, I'll try to get those posted later on.

The only place in King County at all that allows model rocketry is called 60 Acre Park in Redmond, WA. I had purchased a number of various D and E sized engines to try out. In short, all the launches went more or less without incident, except that there was a bit of a wind and the Big Daddy suffered from serious windcocking (where the rocket hooks into the wind). We adjusted the launch rod as best we could, but that did not really help much. Luckily, the parachute deployed properly each time and was able to drift the rocket back into the park ;)

I think over the next year I'll dig deeper into this rocketry thing. Perhaps I'll build a 10,000+ foot rocket, or send some helpless GI-JOEs into orbit...


Happy Halloween!


The drill press makes pumpkin carving a bit easier.