# What is the mathematical equation used to calculate the distance between earth and the sun at any given day of the year?

Aug 20, 2017

A good approximation to calculating the distance from the sun is to use Kepler's first law.

#### Explanation:

The Earth's orbit is elliptical and the distance $r$ of the Earth from the Sun can be calculated as:

$r = \frac{a \left(1 - {e}^{2}\right)}{1 - e \cos \theta}$

Where $a = 149 , 600 , 000 k m$ is the semi-major axis distance, $e = 0.0167$ is the eccentricity of the Earth's orbit and $\theta$ is the angle from perihelion.

$\theta = \frac{2 \pi n}{365.256}$

Where $n$ is the number of days from perihelion which is 3rd January.

Kepler's law gives a fairly good approximation to the Earth's orbit. In actual fact the Earth's orbit is not a true ellipse as it constantly being changed by the gravitational pull of the other planets.

If you want a really accurate value you need to use numerical integration data such as NASA's DE430 data. This data consists of a large number of coefficients for a series of polynomial equations which have been derived from observations and satellite data.