Wednesday, January 11, 2006

Coordinate transformations

This entry is somewhat related to the previous one and mostly I am writing it up a) to let the world know how I wasted an afternoon with non-trivial trivialities, b) as notes for myself to save me time if I ever have to do this again and c) to maybe find an expert around who can verify my result.
The question I was trying to solve was: What is the ecliptic north pole in galactic coordinates?

So this entry is about transformations between different systems of coordinates. So, what's the cast?

  1. There are good old spherical coordinates (theta, phi), where theta is the angle in radians between the point and the z-axis and phi is the (signed!) angle in radians of the projection of the point to the xy-plane an the x-axis. These spherical coordinates are such that the z axis is normal to the galactic plane and the x-axis points towards the galactic centre.
  2. Closely related are cartesian coordinates (x,y,z). There is some redundancy as x^2+y^2+z^2=1 but the advantage is that there is an easy expression for the scalar and cross product between to arbitrary points and this for example makes it easy to compute angles between points.
  3. What astronomers call galactic coordinates are pairs (l,b) which are closely related to theta and phi. At first you might think they are the same, but once you start computing things you realise that l corrsponds to phi and b to theta, so the order is reversed, then they are usually quoted in degrees (and decimal parts) and not in radians and last b is the angle between the point and the xy plane and not the z axis. So numerically (l,b)=(phi*180/Pi, 90-theta*180/Pi)
  4. Then there are equatorial coordinates (alpha, delta). Those are again similar to spherical coordinates but now the z axis points along the earth axis and the x-axis points to the vernal equinox. Again, people use the convention that delta, the declination, is the angle between the point and the equatorial plane (and not the earth axis) and just to make things a little more colorful, alpha, called the right ascession, is not quoted in degrees but in hours, minutes, and seconds (with decimal parts). The convention for delta that I found is degrees, minutes, seconds and I hope that 60 seconds is a minute and 60 minutes is a degree and not like some GPS receivers that use 100s instead of 60s.
  5. Actually, the earth axis is not exactly fixed in space but precesses (amongst other things), so there are actually at least two common versions of equatorial coordinates, those w.r.t. the earth axis at some moment in 1950 and those w.r.t. some moment in 2000 (Julian calender of course).
  6. Finally, there are ecliptic coordinates (lambda, beta), again of the spherical, degree type. So the ecliptic north pole that I am after has beta=90 degrees, lambda undefined. Wikipedia
    gives formulas to convert between these and equatorial coordinates (which? 4. or 5.?)
Unfortunately, using google I was not able to find formulas to reliably convert any of 4./5./6. to 1./2. There is an online calculator but I would rather like to have a formula than a black box. So I have to come up with one on my own. Again, Wikipedia helps: It lists the coodinates of z-axis and the x-axis of 1./2. in coordinate systems 4. and 5.. Now I can do the following: I go to the cartesian coordinate system with respect to 5. and from the second web page I read off two vectors ez and ex (the unit vectors in the galactic north direction and towards the galactic centre).

Then cos(theta) is given in terms of the scalar product between ez and enp, the unit vector towards the ecliptic north pole. phi is slightly more complicated as giving it in terms of cos(phi) from a scalar product is not sufficient since this cannot tell the difference between phi and 2pi-phi. But the quadrant aware two argument version of arctan does the job: phi = arctan( (ez x ex).enp / ex.enp ) where x is the cross and . is the scalar product.

After all this pain, I arrive at (theta,phi) = (0.682213, -0.0287665) or if you prefer (l,b) = (-1.6482degrees, 50.9121degrees). Could anybody please confirm this?

5 comments:

Chris Oakley said...

Reingold and Dershowitz is a great book, but they are a bit out of touch. First: Hindu Lunar calendars nowadays are based on accurate astronomy and not the Surya Siddhanta. Second: "Observational" Islamic calendars (which are by far the most common) tend to use more complex crescent visibility criteria than the one given in the book. Having said said, R & D are great for arithmetic calendars, although why one should care about (e.g.) the French Revolutionary calendar, I am not sure.

Chris Oakley said...

Oh sorry, I meant to post that comment next to your posting about calendars - please delete.

D R Lunsford said...

Sorry the NEP in galactic coordinates is about gal.long 96.3, gal.lat 29.8.

The transformations are easy to work out from first principles. Just derive the formulas for spherical trig

cos A = cos B cos C + sin B sin C cos a

where A, B, and C are arcs that make up a spherical triangle, a the included angle made by arcs B and C. Note that if A, B, and C are small relative to pi, then to 2nd order this formula implies

A^2 = B^2 + C^2 - 2BC cos a

which is the correpsonding formula in plane geometry.

Then derive

sin A / sin a = .. = sin C / sin c

Michael Lewis said...

The galactic coordinate system seems to be reported as having its north pole 123 degrees from its equatorial zero of longitude. That sounds like so much b###s###. It's just one more reason why the zero of galactic longitude should be fixed to some exterior object, preferably the Andromeda Galaxy. Then the galactic coordinate system would work like Ecliptic coordinates. While this neglects the precession of the equinoxes, that's not a problem because an equivalent problem will probably show up in galactic coordinates as the Solar System has a north-south component to its orbit. Of course the times involved are staggering, 220 million years go go around once. But the galaxy turns about a second of arc in 170 years, and that's enough to phase out many astronomical records. Already satellites have been put into orbit with design lifetimes of millions of years, including the US LAGEOS, Russin ETALON, French STARLETTE and the Japanese AJISAI geodetic satellites. Apart from all that, there's not much sense trusting the present system of galactic coordinates, it's like looking at the center column on a carousel too long.

costa rica vacation said...
This comment has been removed by a blog administrator.