<p><em><strong>It looks like your question will be closed</strong></em> since you haven't responded to the comments asking for additional information yet, so I'll leave a partial answer. I can update this once you respond to the comments asking for details.</p>
<p><a href="https://i.sstatic.net/2Fbzb.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/2Fbzb.png" alt="What is Parallax?" /></a></p>
<p><a href="https://en.wikipedia.org/wiki/Parallax" rel="nofollow noreferrer">Parallax</a></p>
<p>The Moon will appear at different RA/Dec at the same time but from different places on the Earth's surface. It's possible the numbers you are comparing to for the Moon are computed for the center of the Earth.</p>
<h3>How big can the effect be?</h3>
<p>The Earth's equatorial diameter is 12756 km. Let's view the Moon from two places on Earth that are separated by only 10,000 km so that the Moon is well above the horizon from both cases. It might be a full moon an hour after rising at one place in the evening while an hour before setting in the morning in another, but still dark in both places.</p>
<p>The distance to the Moon is on average about 384,000 km. That means the Moon's apparent position will vary by about +/-0.75° compared to a general value calculated for the geocenter.</p>

CC BY-SA 4.0
2021-07-11T05:38:46.923Z
2021-07-11T05:38:46.923Z
uhoh
<p>There's no difference in the calculations, but the Moon, Sun, planets don't have more or less fixed right ascensions and declinations like all the stars. The site you linked seems to only work for stars. Where are you getting ephemerides for non-stars?</p>

CC BY-SA 4.0
2021-06-09T13:30:40.090Z
I'm calculating them for the Moon from a known algorithm ...
Micheal J. Roberts
CC BY-SA 4.0
2021-06-11T11:51:51.650Z
There is a difference for the Moon. The geocentric RA and Dec that are calculated need tobe converted to topocentric RA and Dec. That can lead to a difference of about 1 degree.
JohnHoltz
CC BY-SA 4.0
2021-06-11T15:45:34.017Z
@JohnHoltz You're saying OP's calculation is missing a parallax correction.  0.6 degrees was acceptable for Betellgeuse.  The horizontal parallax of 1 degree for the Moon isn't that much more, and is a true worst-case.
stretch
CC BY-SA 4.0
2021-06-13T03:40:05.200Z
@stretch. To clarify, you said there "is no difference in the calculation" for the Moon compared to a star. I am saying that there is a difference. Most algorithms calculate the geocentric coordinates of the Moon. The geocentric RA and Dec need to be converted to topocentric RA and Dec in order to calculate accurate altitude and azimuth.  I do agree with you that the 0.6 degree difference for Betelgeuse is large. A similar "error" could explain the difference that was obtained for the Moon. We need more information from the OP to figure out the problem.
JohnHoltz
CC BY-SA 4.0
2021-06-09T13:27:47.000Z
2021-06-09T13:27:47.000Z
stretch
<p>I'm currently attempting to calculate the equatorial sky position of the Moon for any given Geostatic position (longitude / latitude) for any given datetime.</p>
<p>I have tested my altitude and azimuth calculations for the major start Betelgeuse. The altitude and azimuth provided match within an accuracy of 0.6 degrees to this online tool:
<a href="https://eco.mtk.nao.ac.jp/cgi-bin/koyomi/cande/horizontal_rhip_en.cgi" rel="nofollow noreferrer">https://eco.mtk.nao.ac.jp/cgi-bin/koyomi/cande/horizontal_rhip_en.cgi</a></p>
<p><a href="https://i.sstatic.net/06KTi.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/06KTi.png" alt="enter image description here" /></a></p>
<p>My programming test (written in the Javascript testing framework &quot;JEST&quot;) is as follows:</p>
<pre><code>test('convertCelestialCoordinatesToEquatorial', function() {
  // Let's find where Betelgeuse will be on the datetime above:
  let { alt, az } = celestia.convertCelestialCoordinatesToEquatorial(
    betelgeuse,
    datetime
  )

  expect(alt).toBeCloseTo(72.78539444063765, 1)
  expect(az).toBeCloseTo(134.44877920325155, 1)
})
</code></pre>
<p>So, I'm confident my calcualtions for converting between celestial coordinates and equatorai coordinates are correct, for the Moon's RA and dec are correct (my calculations are correct with three different online widgets to a good level of precision).</p>
<p>However, when I convert the RA and dec of the Moon I know to be correct, through the equatorial conversion function I also know to be correct for distance stellar objects, I get an incorrect value for the altitude and azimuth of the Moon.</p>
<p>This leads me to assume that the equatorial conversion for distant objects can not apply to the Moon, due to various effects that haven't been factored in...</p>
<p>So my question:</p>
<p><em>Does anyone know the calculation to convert between RA and dec for solar system objects?</em></p>

CC BY-SA 4.0
2021-06-09T15:10:47.553Z
How large was the difference between computed and expected positions for the Moon?
Mike G
CC BY-SA 4.0
2021-06-13T03:38:39.157Z
Can you indicate what values your program calculated for all of the items? A difference of 0.6 degrees is large if your input is the same as the reference website. Also, was the input the same? In particular, is the RA and Dec of Betelgeuse the same?
JohnHoltz
<the-moon><solar-system><coordinate>
Conversion of Moon's Celestial Position (RA and dec) to Horizontal Coordinates
Micheal J. Roberts
# Conversion of Moon's Celestial Position (RA and dec) to Horizontal Coordinates

(Asked by: username_0 on 2021-06-09)

I'm currently attempting to calculate the equatorial sky position of the Moon for any given Geostatic position (longitude / latitude) for any given datetime.
I have tested my altitude and azimuth calculations for the major start Betelgeuse. The altitude and azimuth provided match within an accuracy of 0.6 degrees to this online tool:
https://eco.mtk.nao.ac.jp/cgi-bin/koyomi/cande/horizontal_rhip_en.cgi

My programming test (written in the Javascript testing framework "JEST") is as follows:
test('convertCelestialCoordinatesToEquatorial', function() {
  // Let's find where Betelgeuse will be on the datetime above:
  let { alt, az } = celestia.convertCelestialCoordinatesToEquatorial(
    betelgeuse,
    datetime
  )

  expect(alt).toBeCloseTo(72.78539444063765, 1)
  expect(az).toBeCloseTo(134.44877920325155, 1)
})

So, I'm confident my calcualtions for converting between celestial coordinates and equatorai coordinates are correct, for the Moon's RA and dec are correct (my calculations are correct with three different online widgets to a good level of precision).
However, when I convert the RA and dec of the Moon I know to be correct, through the equatorial conversion function I also know to be correct for distance stellar objects, I get an incorrect value for the altitude and azimuth of the Moon.
This leads me to assume that the equatorial conversion for distant objects can not apply to the Moon, due to various effects that haven't been factored in...
So my question:
Does anyone know the calculation to convert between RA and dec for solar system objects?

**Tags:** the-moon, solar-system, coordinate
> **Comments:**
> **username_1**: How large was the difference between computed and expected positions for the Moon?  
> **username_2**: Can you indicate what values your program calculated for all of the items? A difference of 0.6 degrees is large if your input is the same as the reference website. Also, was the input the same? In particular, is the RA and Dec of Betelgeuse the same?  

---

## 2 answers

### Answer by username_3 on 2021-07-11. Score: 1

***It looks like your question will be closed*** since you haven't responded to the comments asking for additional information yet, so I'll leave a partial answer. I can update this once you respond to the comments asking for details.

[![What is Parallax?](https://i.sstatic.net/2Fbzb.png)](https://i.sstatic.net/2Fbzb.png)

[Parallax](https://en.wikipedia.org/wiki/Parallax)

The Moon will appear at different RA/Dec at the same time but from different places on the Earth's surface. It's possible the numbers you are comparing to for the Moon are computed for the center of the Earth.

### How big can the effect be?

The Earth's equatorial diameter is 12756 km. Let's view the Moon from two places on Earth that are separated by only 10,000 km so that the Moon is well above the horizon from both cases. It might be a full moon an hour after rising at one place in the evening while an hour before setting in the morning in another, but still dark in both places.

The distance to the Moon is on average about 384,000 km. That means the Moon's apparent position will vary by about +/-0.75° compared to a general value calculated for the geocenter.


---

### Answer by username_4 on 2021-06-09. Score: 0

There's no difference in the calculations, but the Moon, Sun, planets don't have more or less fixed right ascensions and declinations like all the stars. The site you linked seems to only work for stars. Where are you getting ephemerides for non-stars?

> **Comments:**
> **username_0**: I'm calculating them for the Moon from a known algorithm ...  
> **username_2**: There is a difference for the Moon. The geocentric RA and Dec that are calculated need tobe converted to topocentric RA and Dec. That can lead to a difference of about 1 degree.  
> **username_4**: @JohnHoltz You're saying OP's calculation is missing a parallax correction.  0.6 degrees was acceptable for Betellgeuse.  The horizontal parallax of 1 degree for the Moon isn't that much more, and is a true worst-case.  
> **username_2**: @stretch. To clarify, you said there "is no difference in the calculation" for the Moon compared to a star. I am saying that there is a difference. Most algorithms calculate the geocentric coordinates of the Moon. The geocentric RA and Dec need to be converted to topocentric RA and Dec in order to calculate accurate altitude and azimuth.  I do agree with you that the 0.6 degree difference for Betelgeuse is large. A similar "error" could explain the difference that was obtained for the Moon. We need more information from the OP to figure out the problem.  

---

