What is the fastest way to estimate the Arc Length of an Ellipse?

3.9k Views Asked by At

To estimate the circumference of an ellipse there are some good approximations.
$a$ is the semi-major radius and $b$ is the semi-minor radius.

$$L \approx \pi(a+b) \frac{(64-3d^4)}{(64-16d^2 )},\quad \text{where}\;d = \frac{(a - b)}{(a+b)}$$

Are there any similar formulas to approximate the arc length of an ellipse from $\theta_1$ to $\theta_2$?

If not what are some computationally fast ways to approximate the arc length to within about $1\%$ to $0.1\%$ of $a$?

2

There are 2 best solutions below

1
On

I'll assume $\theta_1$ and $\theta_2$ refer to the parametrization $$ \eqalign{x &= a \cos(\theta)\cr y &= b \sin(\theta)}$$ of the ellipse. Thus the arc length in question is $$ L = \int_{\theta_1}^{\theta_2} \sqrt{a^2 \sin^2(\theta) + b^2 \cos^2(\theta)}\; d\theta $$ We want a good approximation of the integrand that is easy to integrate. It may be best to look at two cases, depending on which of the terms inside the square root is larger.

For $a |\sin(\theta)| \ge b |\cos(\theta)|$, we take $$\sqrt{a^2 \sin^2(\theta) + b^2 \cos^2(\theta)} = a |\sin(\theta)| \sqrt{1 + \frac{b^2}{a^2} \cot^2(\theta)}$$ and look for a good approximation of $\sqrt{1+t^2}$ for $0 \le t \le 1$. The best polynomial approximation of degree $3$ for this is approximately $$ 1.000127929-0.00619431946 \;t+.5478616944\; t^2-.1274538129\; t^3$$ with maximum absolute error $\approx .0001280863448$. Write these coefficients as $c_0, \ldots, c_3$. Thus on the part of the interval where $a |\sin(\theta)| \ge b |\cos(\theta)|$, we can integrate $$ \pm a \sin(\theta) \left(c_0 + c_1 \frac{b}{a} \cot(\theta) + c_2 \frac{b^2}{a^2} \cot^2(\theta) + \frac{b^3}{a^3} \cot^3(\theta)\right)$$ ($+$ on an interval where $\sin(\theta) \ge 0$, $-$ where $\sin(\theta)<0$). An antiderivative is $$ \pm\left( - a c_0 \cos(\theta) + b c_1 \sin(\theta) + \frac{b^2}{a} c_2 \left(\cos(\theta)+\ln(\csc(\theta)-\cot(\theta))\right) - \frac{b^3}{a^2} (\csc(\theta)+\sin(\theta))\right)$$ Similarly, for $a |\sin(\theta)| \le b |\cos(\theta)|$ take $$\sqrt{a^2 \sin^2(\theta) + b^2 \cos^2(\theta)} = b |\cos(\theta)| \sqrt{1 + \frac{a^2}{b^2} \tan^2(\theta)}$$ and integrate $$\pm b \cos(\theta) \left(c_0 + c_1 \frac{a}{b} \tan(\theta) + c_2 \frac{a^2}{b^2} \tan^2(\theta) + c_3 \frac{a^3}{b^3} \tan^3(\theta) \right)$$

0
On

Here is another approach which may be fruitful. Assume $a,b$ are the elongations at max x or y coordinate respectively. (same as Robert Israel answer $x=a\cos(\theta),b\sin(\theta)$) $${\bf F} = {\bf I_N}\otimes diag([a,b])$$

$${\bf M}=\left[\begin{array}{rr}\cos(\theta)&\sin(\theta)\\-\sin(\theta)&\cos(\theta)\end{array}\right]$$

$${\bf M_{big}} = [{\bf 0}^T,{\bf I_{N-1}}]^T\otimes {\bf M}$$

Then add a $\bf I_2$ at upper left corner of $M_{big}$. Now $${\bf F}{\bf (M_{big})}^N[1,0,0,0\cdots]^T$$ Will discretely step through at steps of $\theta$ and we will get a vector "snake" of coordinates on the ellipsis. This is not exactly what we want, but it is a good start. Next comes to differentiate this snake. We can do this approximately by designing a $\bf D$ matrix with -1 and 1 in the right positions. We can leave details as an exercise to the curious student. Now if we put it together, we will get a vector of $[\Delta x, \Delta y]^T$ vectors along the snake.

We want to sum their length, we can do this by reshaping vector to $2\times N$ matrix multiplying with $[1,i]$ and taking euclidean norm. We now have a vector of euclidean length snake segments. What remains is to sum up this vector. A sum can be implemented by scalar product with a ${\bf 1} = [1,1,\cdots,1]^T$ vector.

If we want to, we can now apply our arsenal of linear algebra tools to analyze this by trying to put this matrix on some canonical form. We can even interpret the length of snake as DC component of an FFT.

Or if we are satisfied already (resulting matrix will become very sparse and numerically nice to compute with) we can just build it and apply it straight away for mechanic computations.

For example $a=1,b=1,\theta = \frac{2\pi}{32}, N=16$ will estimate circumference of half unit circle. We get $3.1214$ which is not so far from $\frac{2\pi}{2}$.

The blue vectors are before we apply $\bf D$ matrix and the red ones is after. Note this example is with $a=4,b=2$

enter image description here


Ah yes as final note $[1,0]^T$ at the top of vector to multiply with is actually $[\cos(\theta_1),\sin(\theta_1)]^T$, and our $\theta$ should be $\frac{\theta_2-\theta_1}{N}$