Finding the average distance from an ellipse to a point
18th Dec 2021
Motivation
I've recently been reading a book called Infinite Powers by Steven Strogatz about the history that led to the development of calculus. This, combined with the subject of conics which I've been studying as part of my university work, led me to start thinking about the Astronomical Unit and how it's calculated.
A Problem
My understanding of the Astronomical Unit was that it represents the average distance between the Earth and the Sun. This understanding leads to an interesting problem: the Earth orbits around the Sun in an ellipse, and there are infinitely many points on that ellipse at which you could measure the distance between the Earth and the Sun. How can we take an average of infinitely many things? This sounds like a problem well suited to calculus.
As it turns out, the Astronomical Unit was originally calculated by taking the average of the Earth's aphelion and perihelion (the furthest and closest points to the sun, respectively).
So it's quite a rough average. I therefore set myself the challenge of finding the true average - the average of the infinitely many distances from the sun to points along the Earth's orbit.
In this post, I'll outline the process I went through to find a general formula for finding the true average of the distances from an arbitrary point to all the possible points along an ellipse. I'll save the final step of deriving the equation of the Earth's elliptical orbit and applying the formula to it for another post.
The Strategy
I'll start this section by saying that I'm an undergraduate student just doing this for fun, so do take my conclusions with some skepticism.
I reasoned that if we can find a function for the distance from an arbitrary point to the point on the ellipse which coincides with the straight line extending from the origin at angle , we could then take evenly spaced values of and take the average of their respective values.
Notice that is replaced with . Dividing by divides the circle around the origin into the appropriate number of slices, and then we multiply the result by to select the appropriate slice. effectively becomes an index.
divided into slices
It's important for the values of to be evenly spaced so as not to introduce a bias towards one or another extreme of the ellipse. The fact that the angles are evenly spaced also makes simplifying the equation much simpler later on, as we'll see.
This average would increase in precision as you take more and more distances (as increases) - much like how a mean average better represents the population as the sample size increases. Continuing the statistics analogy, the population we're dealing with is infinitely large, meaning no matter how large (but finite) our sample size , the result will still only be a rough average.
Average gets more accurate as
The true average distance would be the limit as approaches infinity.
So the strategy can be summarised as follows:
- Find a function for the distance from a given point on an ellipse in standard position to an arbitrary point .
- Find a function for the average of the distances between evenly spaced points on the ellipse and the point (using the function found in part 1).
- Find the limit of the function found in part 2 as .
Step 1: A function for the distance from to a point on the ellipse
To find a function for the distance from a point on the ellipse to the point , we can start with the standard formula for the distance between two points
but since we're looking for a function, we'll need to square both sides. This will just mean taking the square root as a final step in calculating the average. So the function will take the form
where and are the coordinates of the point on the ellipse.
The equation of any ellipse in standard position takes the form
where and are constants. However, this can be parametrised into two separate formulas for and .
Therefore, our function for the square of the distance will be
Step 2: A function for the average of distances
Now that we have a function for a single square distance from to a point on the ellipse, the function for the average of distances will take the form
For small values of , this is quite simple to calculate by hand. For example:
However, the numerator becomes longer as gets larger, and since we're trying to find the limit as this method will become unmanageable. Therefore, we need to find a way to express the same rule for the function without the need for series notation.
The first step in doing this is to use some of the rules for manipulating series to simplify as much as possible. For simplicity, let's focus on the numerator.
Next we can use the two trigonometric half angle identities
to remove the and functions.
The expression now looks very long and complex, but we can divide and conquer by using the following rule for manipulating a series
to replace the single long series with a simpler series for each subexpression, which we can then sum together.
These resulting series can be simplified substantially if we remember that , , and are all constants, and therefore we can apply the following two further rules.
The expression becomes
Earlier I mentioned the importance of the values of being evenly spaced. This step is where that becomes relevant. As it happens, the fact that the values are evenly spaced means that all our remaining sums (sums of sine and cosine) evaluate to zero.
I won't provide a proof for this here as this post is already becoming cumbersome with equations, but I found this article very helpful https://matthew-brett.github.io/teaching/sums_of_cosines.html. It also makes sense intuitively if we remember that the sine and cosine are just the and components of the point on the unit circle corresponding with the angle , respectively. By virtue of the points on the unit circle being evenly spaced, each point's distance from the relevant axis is cancelled out by a point on the opposite side.
Sums of sines and cosines cancel to 0
So, we can remove the remaining sums from our expression which leaves us with the following much simpler one.
Bringing this back into context, this is the numerator in our original expression for the square of the average distance from the infinitely many points on the ellipse to the point .
I was surprised at how concise this formula is. Moreover, Step 3 for finding the limit as has become irrelevant since is entirely cancelled from the expression; as approaches infinity it is always cancelled by the denominator.
Trying it out
Let's try the formula on an example point and ellipse.
I won't prove the accuracy of the formula here, but this result matches the approximation we get from Maxima with a value of (essentially calculating an approximate value by brute force).
In another post I'll return to the example of the Earth's orbit around the Sun, and attempt to find the average distance between them using this formula.