1) I'm also using the second edition.

2) There were no

*intentional *changes to the algorithm. I've checked other programs I've written that are based around this code pretty darn closely, but Mega version could contain some typos.

It looks my book has the same calculation for the Mean Anomaly of the Sun that yours does. I can't find where I got the

m = 357.52910 + 35999.05030 *t - 0.0001559 *t*t - 0.00000048*t*t*t;

from, but I know I didn't just make it up. I'm sure it's in there somewhere. Its just a slightly more accurate version of the same thing that is probably sitting in some footnote somewhere. Page 338 has another similar version for the sun's mean anomaly which is yet another slightly different version of the same thing.

3) It probably wouldn't be a bad idea to convert some of the angles to radians ahead of time. Now that I'm looking at it, I'm not sure why I didn't do that in the first place. It would save some computation time.

4) The multiply / divide by 15 explanation is hardly mentioned in the Meeus book. I spent several very frustrating hours trying to figure out why my output wasn't matching the book's before I finally figured out what was going on. For whatever reason, astronomers sometimes measure angles in hours, not degrees or radians. To convert from an angle measured in degrees to an angle measured in hours, just divide by 15.

So (360 degrees)/15 = 24 hours.

I'm not an astronomer, but I'm guessing that this must be some convention that is assumed knowledge.

Now that I'm looking at the code though, it seems like the whole mess could be skipped over for the sake slightly more efficient calculations.

You may have already seen this, but the code I have for the Maple microcontroller is a lot easier to read than the Mega's code.

http://cerebralmeltdown.com/forum/index.php?topic=332.0