Sunday, May 6, 2007

I was going to use the phrase "unrelated news" in this blog post, which made me think of a database structure with a table for news-item relations

... and clearly these two news items would not be expressed as a pair in this table.

I've had a few dreams lately in which I was in college, living in the dorms, and just got a cat to live with me and my roomies. But this cat, he is pure evil. You can see it in the little bastard's eyes. The second you fall asleep he's going to eat you. Then he's going to look up your grandma in your address book, hitch a ride to her place, and eat her.

Also in these dreams I have the ability to drink a 16-ounce glass of straight gin and still go to class, just a little bit impaired.

It's a very good thing I don't really have that ability.

In un-related news...

My "moongazing plugin" for gaim is almost finished! All I have to do is set up the callbacks for periodic updates (this is easy, I know how to do it) and then apply the logic I'm using for profiles to status messages. Well, then I have to rewrite the moon-positioning code because my current source for that code is xearth and xearth, while open-source, has a non-GPL compatible license (specifically, it appears to prohibit distribution for commercial use) and gaim (which my program is also a derivative work of) uses the GPL. Obviously I can comply with both licenses uness I distribute the work. It should be an interesting problem to hack at, given Wikipedia as documentation. And maybe I'll need a more precise source for the parameters of the moon's rotation.

But, like the Rolling Stones playing a cover of some band whose name I don't remember, I ain't too proud to beg: if any of you can tell me how to find the location on the surface of the Earth (... how shall I specify this accurately ...) through which passes a displacement vector from the center of the earth to the center of the moon, I'm dying to know.

But yeah, I'm doing the C coding, which I know I can hack out, first.

Oh, and gaim is now "Pidgin". So s/gaim/Pidgin/g, k?

1 comment:

John Dimond said...

Here are some tips that will make the problem easier for you. The moon's orbit is inclined about 5.14 degrees with respect to the ecliptic plane (the plane in which the Earth and other planets rotate around the Sun). The ecliptic's intersection with Earth is a great circle with inclination about 23.4 degrees and nodes (intersections with the equator) at longitude 0 at 180. The Moon's orbit with respect to the ecliptic is inclined about 5.14 degrees, and its nodes process with a period of about 18.4 years. To figure out the position of the nodes at a given time, find the date of a total solar eclipse. One node of the moon's orbit will lie on the ecliptic at the date on which the eclipse occurred (and the other is 180 degrees around the ecliptic). This will give you a starting point from which to find the nodes of the moon's orbit with respect to the ecliptic on Earth on any given date.

Once you have the moon's orbital line (the great circle inclined 5.14 degrees from the ecliptic about the nodes on a given date), then you can find the Moon's position on that line by using the time since the last new moon. Moon's synodic period is 29.53 days (I'd use synodic here because rotations need to bring you back to the ecliptic).

Now you have its location with respect to the stars, and it will trace along a line of latitude as the Earth spins. The longitude is based on the time of day. I think if you take the UTC time (from Greenwich), convert it to degrees, and add the longitude of the Moon's position with respect to the stars.

And there you have it: a method to find the long./lat. above which the moon is directly at a given date/time.

Phew. BTW, I only looked up the numbers in that. The rest of it is from memory! Whee astro!!