<p>As per wikipedia (<a href="https://en.wikipedia.org/wiki/Lunar_distance" rel="nofollow noreferrer">source</a>)</p>
<blockquote>
<p><span class="math-container">$$
\begin{alignat}{3}
\frac{d}{\mathrm{km}} = 385000.5584 &amp; \ -\ 20905.3550  \cdot \cos(G_M)     \\
                                &amp; \ -   \  3699.1109  \cdot \cos(2D - G_M)      \\
                                &amp; \ -   \  2955.9676  \cdot \cos(2D)            \\
                                &amp; \ -   \ 569.9251    \cdot \cos(2G_M)          \\
                                &amp; \ \pm \ \dotsc
\end{alignat}
$$</span></p>
<p>where <span class="math-container">$G_M$</span> is the mean anomaly (more or less how far the moon has moved from perigee) and <span class="math-container">$D$</span> is the mean elongation (more or less how far it has moved from conjunction with the Sun at new moon). They can be calculated from</p>
<p><span class="math-container">$$G_M  =   134.963 411 38° + 13.064 992 953 630° · t$$</span></p>
<p><span class="math-container">$$D    =   297.850 204 20° + 12.190 749 117 502° · t$$</span></p>
<p>where <span class="math-container">$t$</span> is the time (in days) since January 1, 2000</p>
</blockquote>
<p>The number of decimal places given in that quote is a little ridiculous, but I shall let you prune them as you please.</p>

CC BY-SA 4.0
2024-06-09T13:02:04.393Z
I tried This equation and these are the results 
`date: 1991/5/19`

`JD: 2448396.04166667`

`T: -0.0862137805156328`

`GM: 133.810028945057`

`D: 296.799193631263`


`d (distance): 392792.08838494 km` which totaly wrong it supposed to equal 370614 km
Ahmed Dyaa
CC BY-SA 4.0
2024-06-09T15:35:15.603Z
Discuss it with wikipeida.  Why is T=-0.086?  what about "t"?
James K
CC BY-SA 4.0
2024-06-10T17:14:02.993Z
T=-0.086   means roughly 10pm on December 31st 1999, not 1991-05-19
James K
CC BY-SA 4.0
2024-06-10T22:43:00.447Z
It's still not clear to me what you're asking. Will you have a way to find the moon's equatorial coordinates? There's no simple formula that's better than interpolating almanac values, or an online lookup. If you know those coordinates, your source would likely also give the distance to the moon.
stretch
CC BY-SA 4.0
2024-06-07T21:33:50.643Z
2024-06-07T21:33:50.643Z
James K
<p>I'm trying to calculate <strong>moon's parallax in it's altitude</strong> depending on the day I need and I followed this formula by <a href="http://www.geoastro.de/elevazmoon/basics/meeus.htm#jd" rel="nofollow noreferrer">geoastro.de Basics of Positional Astronomy and Ephemerides</a></p>
<p>but I need to calculate it's distance first and I don't know how to calculate it.</p>
<p>So is there formula or resource can help me.</p>
<p><strong>moon's parallax formula</strong></p>
<pre><code>horParal = 8.794 / (moonDistance / 149.59787E6);
p = arcsin[cos(altitude)*sin(horParal/3600)];
</code></pre>
<p><strong>Notes:</strong> altitude = 36.1° &amp; moonDistance is in meters.</p>

CC BY-SA 4.0
2024-06-07T21:06:28.640Z
The average distance to the moon is 384.4 million metres
James K
CC BY-SA 4.0
2024-06-07T21:13:35.633Z
The distance between the Moon and Earth varies from day to another, so I need it's formula to calculate the distance depending on the day I need
Ahmed Dyaa
CC BY-SA 4.0
2024-06-07T22:07:13.543Z
The author gives a few references, the Meeus algorithm he refers to is available here: https://celestialprogramming.com/meeus-elp82.html
Greg Miller
<the-moon><distances><mathematics><parallax>
How to calculate moon's distance and parallax in it's altitude
Ahmed Dyaa
# How to calculate moon's distance and parallax in it's altitude

(Asked by: username_0 on 2024-06-07)

I'm trying to calculate moon's parallax in it's altitude depending on the day I need and I followed this formula by geoastro.de Basics of Positional Astronomy and Ephemerides
but I need to calculate it's distance first and I don't know how to calculate it.
So is there formula or resource can help me.
moon's parallax formula
horParal = 8.794 / (moonDistance / 149.59787E6);
p = arcsin[cos(altitude)*sin(horParal/3600)];

Notes: altitude = 36.1° & moonDistance is in meters.

**Tags:** the-moon, distances, mathematics, parallax

> **Comments:**
> **username_1**: The average distance to the moon is 384.4 million metres  
> **username_0**: The distance between the Moon and Earth varies from day to another, so I need it's formula to calculate the distance depending on the day I need  
> **username_2**: The author gives a few references, the Meeus algorithm he refers to is available here: https://celestialprogramming.com/meeus-elp82.html  

---

## 1 answers

### Answer by username_1 on 2024-06-07. Score: 1

As per wikipedia ([source](https://en.wikipedia.org/wiki/Lunar_distance))

> $$
> \begin{alignat}{3}
> \frac{d}{\mathrm{km}} = 385000.5584 & \ -\ 20905.3550 \cdot \cos(G\_M) \\
> & \ - \ 3699.1109 \cdot \cos(2D - G\_M) \\
> & \ - \ 2955.9676 \cdot \cos(2D) \\
> & \ - \ 569.9251 \cdot \cos(2G\_M) \\
> & \ \pm \ \dotsc
> \end{alignat}
> $$
>
> where $G\_M$ is the mean anomaly (more or less how far the moon has moved from perigee) and $D$ is the mean elongation (more or less how far it has moved from conjunction with the Sun at new moon). They can be calculated from
>
> $$G\_M = 134.963 411 38° + 13.064 992 953 630° · t$$
>
> $$D = 297.850 204 20° + 12.190 749 117 502° · t$$
>
> where $t$ is the time (in days) since January 1, 2000

The number of decimal places given in that quote is a little ridiculous, but I shall let you prune them as you please.

> **Comments:**
> **username_0**: I tried This equation and these are the results  `date: 1991/5/19`  `JD: 2448396.04166667`  `T: -0.0862137805156328`  `GM: 133.810028945057`  `D: 296.799193631263`   `d (distance): 392792.08838494 km` which totaly wrong it supposed to equal 370614 km  
> **username_1**: Discuss it with wikipeida.  Why is T=-0.086?  what about "t"?  
> **username_1**: T=-0.086   means roughly 10pm on December 31st 1999, not 1991-05-19  
> **username_3**: It's still not clear to me what you're asking. Will you have a way to find the moon's equatorial coordinates? There's no simple formula that's better than interpolating almanac values, or an online lookup. If you know those coordinates, your source would likely also give the distance to the moon.  

---

