Approximate astronomical positions

Converting from polar to rectangular coordinates

[Root] [Branch]

This page contains a detailed description of the derivation of the formulas for the equatorial rectangular coordinates of a star from the RA and the DEC. If you know the basic trigonometry of a right angled triangle, you should have no special problems with this section.

The system of rectangular coordinates used has;

We assume that the stars are all at the same distance from the centre of the celestial sphere, and we may as well call that distance 1 unit. Suppose we call the origin of our set O, and suppose a star is at S, so the line OS has length 1 unit. You can work out the x, y, and z coordinates of the star using nothing more than the trigonometry of two right angled triangles. The situation is shown in fig 1 if you are using a graphical browser to view these pages;

perspective view of left
handed set of axes with a star at S

The Z coordinate of the star's position is equal to the length of a line dropped down from the star to the XY plane. Call the point in the XY plane directly underneath the star S'. The Z coordinate of the star is now the length SS' (see fig 1).

We now have a right angled triangle with hypotenuse OS (see fig 2 below for a clearer view of the triangle).

The triangle OSS'

To get the values of the Y and X coordinates, we need to look at another triangle, in the XY plane (see fig 3). You need to imagine that the Z axis is pointing out of the screen.

The triangle OS'y

Summarising these results we get;

    X = cos(ra) * cos(dec)
    Y = sin(ra) * cos(dec)
    Z = sin(dec)

You may not be at all surprised to learn that the same reasoning applies to geocentric ecliptic coordinates. This time the axes are;

We get the following formulas (where L is ecliptic longitude and B is ecliptic latitude)

    X = cos(L) * cos(B)
    Y = sin(L) * cos(B)
    Z = sin(B)

[Root] [Branch]

Last Modified 6th September 1998
Keith Burnett

keith@xylem.demon.co.uk