# Calculate distance to Sun

At Cornell University's Ask an Astronomer I was reading How can I find the distance to the Sun on any given day? (Advanced) and it mentioned you can find the distance to the Sun on any day of any year once you know how many days after the last perihelion that day was.

What is the equation for that? Do you still need $$a, \epsilon, T$$?

This is a follow-up question to this answer.

• You may find this answer helpful. You can calculate $t(\theta)$ directly analytically (time for a given angle), but getting $\theta(t)$ requires either an approximation such as a series expansion, or an itterative solution like Newton's Method as I've shown there. Either way, once you have $\theta$ you can calculate $r$.
– uhoh
Nov 11 '20 at 8:02
• If you are only interested in the distance and not the angle, then you can ignore $\theta$ and just treat the radial oscillations using a fictitious force: Can the radial oscillations of an elliptical orbit be solved using a fictitious centrifugal potential? I assume that again you'll be able to get $t(r)$ analytically but need to approximate or iterate to get $r(t)$.
– uhoh
Nov 11 '20 at 8:06
• ... assume but not sure, so only leaving this as a comment.
– uhoh
Nov 11 '20 at 8:14
• – gerrit
Nov 11 '20 at 9:28

Like uhoh said in a comment, while $$t(r)$$ is analytical, $$r(t)$$ to my knowledge is not.

$$t(r)$$ can however be used very efficiently to approximate $$r(t)$$ since every iteration of $$t(r)$$ will give you the same number of extra digits, thus converging very quickly.

Here is the derivation of an analytical $$t(r)$$.

1. The distance from $$r_P$$ to $$K$$ (the Earth projected down on the apsis line), let's call it $$d$$, is:

$$d = \frac{2a(r - r_P)}{(r_A - r_P)}$$

1. The angle between the apsis line and the line from the geometric centre to the Earth projected out on the semi-major circle is:

$$\beta =\cos^{-1}\left(\frac{a-d}{a}\right)$$

1. The projected swept area is now the sector area minus the triangle between the Sun, the geometric centre and the projected Earth.

$$A_{proj} = \frac{\beta a^2}{2} - \frac{(a - r_P)\sqrt{a^2 - (a - d)^2}}{2}$$

1. From that, we can get the real swept area by scaling back by the ratio between the semi-major and semi-minor axis:

$$A_{swept} = A_{proj} \cdot \frac{b}{a}$$

1. Which from Kepler's third law can be used to calculate the time since periapsis:

$$T_{since\ periapsis} = 2\pi\sqrt{\frac{a^3}{\mu}} \cdot \frac{A_{swept}}{ab\pi}$$

• Just... Beautiful!
– uhoh
Nov 11 '20 at 15:18