@sdmitch said:
Azimuth is the counter-clockwise angle measured from the +X axis.
Exactly, though I guess I should have been more clear on altitude; I mean in the sense of aligning an alt/az mount, so it would actually be pitch.
I'll dig through that script and see if I can think clearly enough this morning to change that part over. Thanks for a heck of a good starting point, though; I was expecting it to take a lot more code than that just to get the azimuth right.