This tutorial explains how to calculate *topocentric* RIGHT ASCENSION (R.A.) & DECLINATION for the Moon.

The JS simulation will also use these calculated coordinates to plot the Moon on the Celestial Sphere. The example code locates the observer at the Palomar Observatory. If desired, you can adjust the location in the SOURCE CODE.

This tutorial builds further upon the fourth tutorial in the series.
Therefore if you haven't followed the fourth tutorial yet for calculating the *geocentric* Epheremis for the Moon, we recommend you do that first:
TUTORIAL - EPHEMERIS MOON (GEOCENTRIC)

Credits for the calculations go to Jean Meeus & Peter Duffett-Smith.

Just like in the previous tutorial, we use Meeus' method of

```
△ = 385000.56 + (∑r / 1000) //Distance Earth-Moon given in kilometers
```

For more information on calculating the sum ∑r, please refer back to SECTION III of the last tutorial or see the source code for this tutorial located HERE.
With the Earth-Moon distance △ calculated in SECTION I you can acquire the geocentric parallax π using the following formula (up to 1°):

```
sin π = 6378.14 / △
```

Once we've acquired GST, we can use it to calculate Local Sidereal Time (LST) to adjust the time for the location of the observer (either West or East of the 0° meridian):

- Convert Julian Day (JD) to Greenwich mean Sidereal Time (GST)
- Convert Greenwich mean Sidereal Time (GST) to Local Sidereal Time (LST)

```
H = LST - Lunar Geocentric Right Ascension
```

```
u = atan (0.996647 * tan Φ)
p sin Φ' = (0.996647 * sin u) + ((observer altitude / 6378140) * sin Φ)
p cos Φ' = (cos u) + ((observer altitude / 6378140) * cos Φ)
```

Note that these formula's use the Moon's Geocentric Right Ascension (R.A.) and Declination from the last tutorial.

```
tan △RIGHT_ASCENSION = (-(p cos Φ') * sin π * sin H) / (cos GEO_DECLINATION - (p cos Φ') * sin π * cos H)
TOPO_RIGHT ASCENSION = GEO_RIGHT_ASCENSION + △RIGHT_ASCENSION
tan TOPO_DECLINATION = ((sin GEO_DECLINATION - (p sin Φ') * sin π) * cos △RIGHT_ASCENSION) / (cos GEO_DECLINATION - (p cos Φ') * sin π * cos H)
```

The finished simulation on the right shows not only the calculated values for Topocentric RIGHT ASCENSION and DECLINATION for an observer located on Palomar Mountain, but also demonstrates how the Moon moves across the sky over time.

Get the full JavaScript source code HERE.

You can also verify the RIGHT ASCENSION and DECLINATION values using NASA's HORIZONS Web-Interface. Make sure to set the Observer Location to the appropriate Topocentric location for comparison.

Get the full JavaScript source code HERE.

You can also verify the RIGHT ASCENSION and DECLINATION values using NASA's HORIZONS Web-Interface. Make sure to set the Observer Location to the appropriate Topocentric location for comparison.