**((users:au:index_e Author))** --- **((algebra2:optimiz:distance:appolonij Русская версия))**
----
!!§!! Satellite page for the section
☞
((:matricese:optimize:distancee:apollonius_e#distance_approximations Distance approximations))
(for the problem of distance evaluation from a point to an ellipse or an ellipsoid)
----
In ((#references [1])), the following formula is suggested for an approximation of the distance from a point to an ellipse in the plane:
$$ d \approx d_{HO} = \sqrt{-B_4/B_3} \, . $$
where $ B_3 $ and $ B_4 $ are the coefficients of the ((:matricese:optimize:distancee:apollonius_e#distance_from_a_point_to_an_ellipse_in_the_plane distance equation)):
$$
\begin{array}{ll}
B_3(x_0,y_0)&=-2\,a^2b^2\bigg\{a^2b^2T_0G_0^2 -\bigg[(a^2+b^2)T_0^2+3\,a^2b^2T_0-6\,a^4b^4S_{4,0}\bigg]G_0 +2\,a^2b^2T_0^2S_{4,0}\bigg\} \, , \\
B_4(x_0,y_0)&=a^{4}b^{4}G_0^2 \left(T_0^2+4\,a^2b^2G_0\right) \, .
\end{array}
$$
and
$$ G_0= G(x_0,y_0)=\frac{x_0^2}{a^2}+\frac{y_0^2}{b^2}-1,\
T_0= x_0^2+y_0^2-a^2-b^2,\ S_{4,0}= \frac{x_0^2}{a^4} + \frac{y_0^2}{b^4} \, .
$$
!!Th!! **Theorem 1** ((#references [2])). //The radicand in// $ d_{HO} $ //is negative iff// $ B_3(x_0,y_0)>0 $.
**Proof** follows from an alternative representation for the coefficient $ B_4 $:
$$
B_4 \equiv a^4b^4G_0^2\left[(x_0^2-y_0^2+b^2-a^2)^2+4\,x_0^2y_0^2 \right] \, .
$$
Therefore, it is nonnegative for any specialization of parameters.
♦
From this theorem it follows that applicability of the approximation $ d_{HO} $ depends crucially on the relative position of the curve
$$
B_3(x,y)=0
$$
with respect to the ellipse. Depending on the parameter specializations, this $ 6 $th order curve contains from $ 2 $ to $ 4 $ ovals (branches).
!!Th!! **Theorem 2** ((#references [2])). //For any specialization of parameters// $ a $ //and// $ b $ //with// $ a >b $, //the curve// $ B_3(x,y)=0 $ //has two ovals lying inside the ellipse. For// $ b< a \le \sqrt{2} b $, //the curve does not have any other oval. For// $ a > \sqrt{2} b $, //the
curve possesses two extra unclosed ovals lying outside the ellipse.//
!!Ex!! **Example.** For the ellipse $ x^2/324+y^2/25=1 $, the curve $ B_3(x,y)=0 $ is displayed[[Since the curves possess a symmetry property w.r.t. the axes, they are displayed only in the first quadrant of the Cartesian plane.]] in the figure:
{{ matricese:optimize:distancee:apollonius_e:hoodz-2.png |}}
The points $ X_0=(x_0,y_0) $ close to the curve $ B_3(x,y)=0 $ break the formula confidence. For instance,
the points close to a tiny oval internal to the ellipse yield
$$
\begin{array}{c|c|c|c|c|c|c}
(x_0,y_0) & (17.20,0) & (17.30,0) & (17.40,0) & (17.48,0 ) & (17.50,0) & (17.60,0) \\
\hline
d_{HO} & 0.33 & n/a & n/a & 4.60 & 1.19 & 0.50
\end{array}
$$
with the //n/a// meaning the negative sign of the involved radicand.
==References==
[1]. **Harker M., O'Leary P.** //First order geometric distance (the myth of Sampsonus)//, Proc. of the British Machine Vision Conference (BMVC06), I, 2006, Edinburgh, UK, P. 87--96.
[2]. **Uteshev A.Yu., Goncharova M.V.** //Point-to-ellipse and point-to-ellipsoid distance equation analysis.// J.Comput. Applied Math., 2018, Vol. **328**, P. 232-251