<p>Your question implies that you know how to calculate the Moon's geographical position (GP): the latitude and longitude of the point on the Earth it's directly above, so, first, find the distance between the Moon's GP and the observer using the law of cosines for spherical triangles applied to the triangle with vertices at the north pole, observer's position and Moon's GP.<br />
Letting &quot;a&quot; be that angular distance, &quot;b&quot; be 90 deg minus observer's latitude, and &quot;c&quot; be 90 deg minus the Moon's GP, and the opposite angles for a,b,c be A,B,C; a = acos((cos(b)cos(c)-sin(b)sin(c)cos(A)). (A is the difference between the two longitudes.) (Remember that acos is double valued.)</p>
<p>The moon's geocentric altitude is 90 deg minus a. Its geocentric (and topocentric) azimuths can best be found by applying the law of sines for spherical triangles: sin(A)/sin(a) = sin(C)/sin(c), so asin(C) = sin(A)sin(c)/sin(A), (also double valued.)</p>
<p>That finishes all that's needed to know about geocentric coordinates. To correct for tropocentric altitude, apply the horizontal parallax factor (HP), which comes with your almanace's RA and declination, usually. From your reference's formula the parallax correction is HP*cos(geocentric altitude), which is subtracted from the geocentric altitude.</p>

CC BY-SA 4.0
2024-10-25T11:59:12.063Z
Thanks for your answer, but I tried the formulas and the results is wrong, the used formula: `double a = 90 - Math.Acos(Math.Cos((90 - latitude) * Deg2Rad) * Math.Cos((90 - eclipticLatitude) * Deg2Rad) - Math.Sin((90 - latitude) * Deg2Rad) * Math.Sin((90 - eclipticLatitude) * Deg2Rad) * Math.Cos(Math.Abs(eclipticLongitude - longitude) * Deg2Rad)) * Rad2Deg;` then `double _geoAltitude = 90 - a;` then `double _topAltitude = _topAltitude - lunarParallax * Math.Cos(_topAltitude * Deg2Rad);`. Note: 1- `Deg2Rad = Math.PI / 180.0` and `Rad2Deg = 180.0 / Math.PI`, 2- I used the formulas on c# script.
Ahmed Dyaa
CC BY-SA 4.0
2024-10-25T12:01:45.000Z
I just tried the the formulas in section 6 of the mentioned resource and I have already computed the Sidereal Time at the Greenwich meridian at 00:00, the LST for the time meridian and The HA then I converted the HA and Decl to rectangular (x,y,z) coordinate, then computed the azimuth and altitude but the results was wrong, and I tried these resource [geoastro](http://stjarnhimlen.se/comp/tutorial.html#6) starting with computing sidereal time at Greenwich then LST at longitude then local HA then I converted them to altitude and azimuth and the results are correct. why?
Ahmed Dyaa
CC BY-SA 4.0
2024-10-27T22:03:02.557Z
Can you add detail about the wrong result?  Your code excerpt , without context, up to the first "then" looks good.  Your "a" is the geocentric altitude. The topocentric altitude (your _topAltitude" I believe) should be that geocentric altitude minus the parallax correction,  HPcos(a).
stretch
CC BY-SA 4.0
2024-10-24T23:25:24.997Z
2024-10-24T23:25:24.997Z
stretch
<p>I followed <a href="http://stjarnhimlen.se/comp/tutorial.html#9" rel="nofollow noreferrer">The Moon's topocentric position</a> to lern how to calculate the moon's position.</p>
<ol>
<li>I have calculated topocentric RA and Decl, but I don't know how to convert it to the moon's horizon coordinates, so is there a formula or resource?</li>
<li>I have calculated geocentric hour angle, so after calculating topocentric RA and Decl, should I calculate the topocenteric hour angle before converting topocentric RA and Decl to the moon's horizon coordinates?</li>
</ol>

CC BY-SA 4.0
2024-10-22T21:21:17.503Z
See section 6 of your resource "Hour angle, altitude and azimuth"  The horizon coordinates are the altitude and azimuth.
James K
CC BY-SA 4.0
2024-10-22T22:01:02.743Z
@JamesK Thank you, but what about number 2?
Ahmed Dyaa
CC BY-SA 4.0
2024-10-22T22:26:29.983Z
Sorry, I didn't get it, in my resource he calculated the HA by these formula `HA = LST - RA = 272.3377_deg` he computed it by the `geocentric RA`, so after I compute the `topocentric RA` should I recomoute the hour angle with the topocentric RA or not?
Ahmed Dyaa
CC BY-SA 4.0
2024-10-23T10:32:11.117Z
I just asked ChatGPT and this it's answer, When you correct the geocentric RA to topocentric RA, you're accounting for the observer's position on the Earth's surface, which means the topocentric RA is now specific to your location. This adjustment can slightly change the object's position in the sky from the observer's perspective.

Since the Hour Angle depends directly on the RA, and you've now updated the RA to the topocentric value, you must recompute the HA with this topocentric RA to get an accurate value for the Moon's current position.
Ahmed Dyaa
CC BY-SA 4.0
2024-10-23T13:59:48.590Z
Let us [continue this discussion in chat](https://chat.stackexchange.com/rooms/155874/discussion-between-ahmed-dyaa-and-james-k).
Ahmed Dyaa
CC BY-SA 4.0
2024-10-23T19:12:31.540Z
@JamesK Hour angle can apply to any body. It's just the difference between the local sidereal time and the right ascension. See https://en.wikipedia.org/wiki/Hour_angle
PM 2Ring
CC BY-SA 4.0
2024-10-23T20:50:10.480Z
@JamesK I just tried the the formulas in section 6 of the mentioned resource and I have already computed `the Sidereal Time at the Greenwich meridian at 00:00`, `the LST for the time meridian` and `The HA` then I converted the HA and Decl to rectangular (x,y,z) coordinate, then computed the azimuth and altitude but the results was wrong, and I tried these resource [geoastro](http://geoastro.de/elevazmoon/basics/index.htm) starting with computing `sidereal time at Greenwich` then `LST at longitude` then `local HA` then I converted them to altitude and azimuth and the results are correct. why?
Ahmed Dyaa
<the-moon><coordinate><positional-astronomy><declination><right-ascension>
The Moon's topocentric position
Ahmed Dyaa
# The Moon's topocentric position

(Asked by: username_0 on 2024-10-22)

I followed [The Moon's topocentric position](http://stjarnhimlen.se/comp/tutorial.html#9) to lern how to calculate the moon's position.

1. I have calculated topocentric RA and Decl, but I don't know how to convert it to the moon's horizon coordinates, so is there a formula or resource?
2. I have calculated geocentric hour angle, so after calculating topocentric RA and Decl, should I calculate the topocenteric hour angle before converting topocentric RA and Decl to the moon's horizon coordinates?

**Tags:** the-moon, coordinate, positional-astronomy, declination, right-ascension
> **Comments:**
> **username_1**: See section 6 of your resource "Hour angle, altitude and azimuth"  The horizon coordinates are the altitude and azimuth.  
> **username_0**: @JamesK Thank you, but what about number 2?  
> **username_0**: Sorry, I didn't get it, in my resource he calculated the HA by these formula `HA = LST - RA = 272.3377_deg` he computed it by the `geocentric RA`, so after I compute the `topocentric RA` should I recomoute the hour angle with the topocentric RA or not?  
> **username_0**: I just asked ChatGPT and this it's answer, When you correct the geocentric RA to topocentric RA, you're accounting for the observer's position on the Earth's surface, which means the topocentric RA is now specific to your location. This adjustment can slightly change the object's position in the sky from the observer's perspective.  Since the Hour Angle depends directly on the RA, and you've now updated the RA to the topocentric value, you must recompute the HA with this topocentric RA to get an accurate value for the Moon's current position.  
> **username_0**: Let us [continue this discussion in chat](https://chat.stackexchange.com/rooms/155874/discussion-between-ahmed-dyaa-and-james-k).  
> **username_2**: @JamesK Hour angle can apply to any body. It's just the difference between the local sidereal time and the right ascension. See https://en.wikipedia.org/wiki/Hour_angle  
> **username_0**: @JamesK I just tried the the formulas in section 6 of the mentioned resource and I have already computed `the Sidereal Time at the Greenwich meridian at 00:00`, `the LST for the time meridian` and `The HA` then I converted the HA and Decl to rectangular (x,y,z) coordinate, then computed the azimuth and altitude but the results was wrong, and I tried these resource [geoastro](http://geoastro.de/elevazmoon/basics/index.htm) starting with computing `sidereal time at Greenwich` then `LST at longitude` then `local HA` then I converted them to altitude and azimuth and the results are correct. why?  

---

## 1 answers

### Answer by username_3 on 2024-10-24. Score: 1

Your question implies that you know how to calculate the Moon's geographical position (GP): the latitude and longitude of the point on the Earth it's directly above, so, first, find the distance between the Moon's GP and the observer using the law of cosines for spherical triangles applied to the triangle with vertices at the north pole, observer's position and Moon's GP.  
Letting "a" be that angular distance, "b" be 90 deg minus observer's latitude, and "c" be 90 deg minus the Moon's GP, and the opposite angles for a,b,c be A,B,C; a = acos((cos(b)cos(c)-sin(b)sin(c)cos(A)). (A is the difference between the two longitudes.) (Remember that acos is double valued.)

The moon's geocentric altitude is 90 deg minus a. Its geocentric (and topocentric) azimuths can best be found by applying the law of sines for spherical triangles: sin(A)/sin(a) = sin(C)/sin(c), so asin(C) = sin(A)sin(c)/sin(A), (also double valued.)

That finishes all that's needed to know about geocentric coordinates. To correct for tropocentric altitude, apply the horizontal parallax factor (HP), which comes with your almanace's RA and declination, usually. From your reference's formula the parallax correction is HP\*cos(geocentric altitude), which is subtracted from the geocentric altitude.

> **Comments:**
> **username_0**: Thanks for your answer, but I tried the formulas and the results is wrong, the used formula: `double a = 90 - Math.Acos(Math.Cos((90 - latitude) * Deg2Rad) * Math.Cos((90 - eclipticLatitude) * Deg2Rad) - Math.Sin((90 - latitude) * Deg2Rad) * Math.Sin((90 - eclipticLatitude) * Deg2Rad) * Math.Cos(Math.Abs(eclipticLongitude - longitude) * Deg2Rad)) * Rad2Deg;` then `double _geoAltitude = 90 - a;` then `double _topAltitude = _topAltitude - lunarParallax * Math.Cos(_topAltitude * Deg2Rad);`. Note: 1- `Deg2Rad = Math.PI / 180.0` and `Rad2Deg = 180.0 / Math.PI`, 2- I used the formulas on c# script.  
> **username_0**: I just tried the the formulas in section 6 of the mentioned resource and I have already computed the Sidereal Time at the Greenwich meridian at 00:00, the LST for the time meridian and The HA then I converted the HA and Decl to rectangular (x,y,z) coordinate, then computed the azimuth and altitude but the results was wrong, and I tried these resource [geoastro](http://stjarnhimlen.se/comp/tutorial.html#6) starting with computing sidereal time at Greenwich then LST at longitude then local HA then I converted them to altitude and azimuth and the results are correct. why?  
> **username_3**: Can you add detail about the wrong result?  Your code excerpt , without context, up to the first "then" looks good.  Your "a" is the geocentric altitude. The topocentric altitude (your _topAltitude" I believe) should be that geocentric altitude minus the parallax correction,  HPcos(a).  

---

