1. Problem
Our approach
Example
Future work
Closed formulae for distance functions
involving ellipses.
F. Etayo1 , L. Gonzalez-Vega1 , G. R. Quintana1 , W. Wang2
1 Departamento de Matemáticas, Estadística y Computación
Universidad de Cantabria
2 Department of Computer Science
University of Hong Kong
VII International Workshop on Automated Deduction in
Geometry
F. Etayo, L. Gonzalez-Vega, G. R. Quintana, W. Wang ADG 2008
2. Problem
Our approach
Example
Future work
Contents
1 Problem
2 Our approach
3 Example
4 Future work
F. Etayo, L. Gonzalez-Vega, G. R. Quintana, W. Wang ADG 2008
3. Problem
Our approach
Example
Future work
Introduction
We want to compute the distance between two coplanar
ellipses.
The minimum distance between a given point and one ellipse is
a positive algebraic number: our goal is to determine a
polynomial with this number as a real root.
This way of presenting the distance is independent of the
corresponding footpoints and provides the distance directly. We
can use this formula for analyzing the Ellipses Moving Problem
(EMP).
F. Etayo, L. Gonzalez-Vega, G. R. Quintana, W. Wang ADG 2008
4. Problem
Our approach
Example
Future work
Applications
The computation of the minimum distance between two ellipses
(static or dynamic) is a fundamental task in various
applications:
collision detection in robotics,
interference avoidance in CAD/CAM,
interactions in virtual reality,
computer games,
orbit analysis (non-coplanar ellipses),
interference analysis of molecules in computational
physics and chemistry,
etc.
F. Etayo, L. Gonzalez-Vega, G. R. Quintana, W. Wang ADG 2008
5. Problem
Our approach
Example
Future work
Previous works
I. Z. E MIRIS , E. T SIGARIDAS , G. M. T ZOUMAS . The
predicates for the Voronoi diagram of ellipses. Proc. ACM
Symp. Comput. Geom., 2006.
I. Z. E MIRIS , G. M. T ZOUMAS . A Real-time and Exact
Implementation of the predicates for the Voronoi Diagram
for parametric ellipses. Proc. ACM Symp. Solid Physical
Modelling, 2007.
C. L ENNERZ , E. S CHÖMER . Efficient Distance
Computation for Quadratic Curves and Surfaces.
Geometric Modelling and Processing Proceedings, 2002.
F. Etayo, L. Gonzalez-Vega, G. R. Quintana, W. Wang ADG 2008
6. Problem
Our approach
Example
Future work
Previous works
J.-K. S EONG , D. E. J OHNSON , E. C OHEN . A Higher
Dimensional Formulation for Robust and Interactive
Distance Queries. Proc. ACM Solid and Physical
Modeling, 2006.
K.A. S OHN , B. J ÜTTLER , M.S. K IM , W. WANG .
Computing the Distance Between Two Surfaces via Line
Geometry. Proc. Tenth Pacific Conference on Computer
Graphics and Applications, 236-245, IEEE Press, 2002.
Common aspect: the problem is always solved by determining,
first, the footpoints and then the searched distance.
F. Etayo, L. Gonzalez-Vega, G. R. Quintana, W. Wang ADG 2008
7. Problem
Our approach
Example
Future work
Our approach
We do not make the minimum distance computation depending
on the determination of the footpoints. We study the ellipse
separation problem by analyzing the univariate polynomial
providing the distance.
Parameters of our problem: center coordinates, axes length,
inclination of the axes.
F. Etayo, L. Gonzalez-Vega, G. R. Quintana, W. Wang ADG 2008
8. Problem
Our approach
Example
Future work
Our approach
We do not make the minimum distance computation depending
on the determination of the footpoints. We study the ellipse
separation problem by analyzing the univariate polynomial
providing the distance.
Parameters of our problem: center coordinates, axes length,
inclination of the axes.
Is there any advantage?
F. Etayo, L. Gonzalez-Vega, G. R. Quintana, W. Wang ADG 2008
9. Problem
Our approach
Example
Future work
Our approach
We do not make the minimum distance computation depending
on the determination of the footpoints. We study the ellipse
separation problem by analyzing the univariate polynomial
providing the distance.
Parameters of our problem: center coordinates, axes length,
inclination of the axes.
Is there any advantage?
Indeed: the distance behaves continuously but footpoints do
not.
F. Etayo, L. Gonzalez-Vega, G. R. Quintana, W. Wang ADG 2008
10. Problem
Our approach
Example
Future work
The distance of a point to an ellipse
We consider the parametric equations of an ellipse, ε0 :
√ √
x = a cos t, y = b sin t, t ∈ [0, 2π)
in order to construct a function fd whose minimum positive
value, d, gives the square of the distance between a point
(x0 , y0 ) and the ellipse:
√ √
fd := (x0 − a cos t)2 + (y0 − b sin t)2 − d
F. Etayo, L. Gonzalez-Vega, G. R. Quintana, W. Wang ADG 2008
11. Problem
Our approach
Example
Future work
The distance of a point to an ellipse
We want to solve a system of equations:
fd (t) = 0
∂fd
(t) =0
∂t
F. Etayo, L. Gonzalez-Vega, G. R. Quintana, W. Wang ADG 2008
12. Problem
Our approach
Example
Future work
The distance of a point to an ellipse
We want to solve a system of equations:
fd (t) = 0
∂fd
(t) =0
∂t
There are two posibilities:
rational change of variable
complex change of variable
F. Etayo, L. Gonzalez-Vega, G. R. Quintana, W. Wang ADG 2008
13. Problem
Our approach
Example
Future work
The distance of a point to an ellipse
Rational change of variable:
1−t2
cos t = 1+t2
2t
sin t = 1+t2
Disadvantage: more complicated.
F. Etayo, L. Gonzalez-Vega, G. R. Quintana, W. Wang ADG 2008
14. Problem
Our approach
Example
Future work
The distance of a point to an ellipse
Rational change of variable:
1−t2
cos t = 1+t2
2t
sin t = 1+t2
Disadvantage: more complicated.
F. Etayo, L. Gonzalez-Vega, G. R. Quintana, W. Wang ADG 2008
15. Problem
Our approach
Example
Future work
The distance of a point to an ellipse
1
Since z = cos t + i sin t, z = z and we can use the complex
change of variable:
1
z− z
sin t = 2i
1
z+ z
cos t = 2
F. Etayo, L. Gonzalez-Vega, G. R. Quintana, W. Wang ADG 2008
16. Problem
Our approach
Example
Future work
The distance of a point to an ellipse
The new system:
√ √ √ √
(b − a)z 4 + 2(x0 √a − iy0 √b)z 3 − 2(x0 a + iy0 b)z + a − b = 0
(b − a)z 4 − 4(x0 a − iy0 b)z 3 − 2(2(x2 + y0 − d))z 2 +
0
2
√
√
+4(x0 a + iy0 b)z + b − a = 0
Using resultants we eliminate the variable z
(and, as a by-product, i disappears).
F. Etayo, L. Gonzalez-Vega, G. R. Quintana, W. Wang ADG 2008
17. Problem
Our approach
Example
Future work
The distance of a point to an ellipse
Theorem
If d0 is the distance of a point (x0 , y0 ) to the ellipse ε0 with
√
√
center (0, 0) and semiaxes of length a and b then d = d2 is 0
[x0 ,y ]
the smallest nonnegative real root of the polynomial F[a,b] 0 (d).
F. Etayo, L. Gonzalez-Vega, G. R. Quintana, W. Wang ADG 2008
18. Problem
Our approach
Example
Future work
[x ,y ]
F[a,b] 0 (d) =
0
= (a − b)2 d4 + 2(a − b)(b2 + 2x2 b + y0 b − 2ay0 − a2 − x2 a)d3
0
2 2
0
+(y0 b − 8y0 ba − 6b a + 6a y0 − 2x0 a + a + 6x2 y0 b2 − 2y0 b3
4 2 2 2 2 2 3 2 2 3 4
0
2 2
4 2 2 2 3 2 2 2 3 4 2 2
+6y0 a + 4x0 a b + 2b a + 6x0 y0 a + 2a b − 6x0 ab + 4y0 b a
+6x4 b2 + 4x4 a2 + 6b3 x2 − 10x2 y0 ab + b4 − 8x2 ab2 − 6y0 ab)d2
0 0 0 0
2
0
4
4 4 2 3 4 6 2 2 6 3 2 2 4
−2(ab + y0 − a b + a b + 2y0 a + 2b x0 − a b − bx0 ay0
4 2 2 2 2 2 2 2 6 2 4 2 4 3
−bx0 ay0 + 3x0 ay0 b + 3x0 a y0 b − by0 a + b y0 x0 + 3x0 b
+3y0 a3 + x2 b4 + x4 a2 y0 − bx6 a − 5x4 ab2 + 3b2 y0 x4 + 3y0 ab2
4
0 0
2
0 0
2
0
4
2 3 2 4 2 2 2 2 2 3 2 3 2 3
−2x0 a u0 + 3x0 a b + 3x0 b y0 − 2x0 ab − 2y0 a b − 3y0 ab
−3x2 a3 b − 2x2 b3 y0 − 5y0 a2 b + 4x2 a2 b2 + 4y0 a2 b2 )d
0 0
2 4
0
2
+(x0 + 2x0 b + b − 2x0 a − 2ba + a + y0 + 2x2 y0 − 2y0 b + 2ay0 )·
4 2 2 2 2 4
0
2 2 2
2 2 2
(bx0 + ay0 − ba) =
4 [a,b]
= k=0 hk (x0 , y0 )dk
F. Etayo, L. Gonzalez-Vega, G. R. Quintana, W. Wang ADG 2008
19. Problem
Our approach
Example
Future work
Remarks to the theorem
[x ,y ]
The biggest real root of F[a,b] 0 (d) is the square of the
0
maximum distance between (x0 , y0 ) and the points in ε0 .
If x0 is a focus of ε0
√
[ a−b,0]
F[a,b] (d) = (a − b)2 d2 (d2 + 2(b − 2a)d + b2 )
√ √ √ √
⇒ d = ( a − a − b)2 , ( a + a − b)2
In the case of a circle a = b = R2 and if d = d2
0
√
[ a−b,0]
F[a,b] (d2 ) = R4 (y0 + x2 )2 ·
0
2
0
2 + 2Rd + R2 − y 2 − x2 )(d2 − 2Rd + R2 − y 2 − x2 )
· (d0 0 0 0 0 0 0 0
⇒ d0 = R − y0 + x2
2
0
F. Etayo, L. Gonzalez-Vega, G. R. Quintana, W. Wang ADG 2008
20. Problem
Our approach
Example
Future work
The distance between two ellipses
Let ε1 be an ellipse disjoint with ε0 , presented by the
parametrization x = α(s), y = β(s), s ∈ [0, 2π). Then
d(ε0 , ε1 ) = min{ (x1 − x0 )2 + (y1 − y0 )2 : (xi , yi ) ∈ εi , i = 1, 2}
is the square root of the smallest nonnegative real root of
[α(s),β(s)]
the family of univariate polynomials F[a,b] (d).
F. Etayo, L. Gonzalez-Vega, G. R. Quintana, W. Wang ADG 2008
21. Problem
Our approach
Example
Future work
The distance between two ellipses
In order to determine d(ε0 , ε1 ) we are analyzing two posibilities:
d is determined as the smallest positive real number s.t.
there exist s ∈ [0, 2π) solving
[α(s),β(s)] 4 [a,b]
F[a,b] = k=0 hk (α(s), β(s))dk = 0
¯ [α(s),β(s)] :=
F[a,b]
4 ∂ [a,b]
(α(s), β(s))dk =
k=0 ∂s hk 0
d is determined by analyzing the implicit curve
[α(s),β(s)]
F[a,b] = 0.
F. Etayo, L. Gonzalez-Vega, G. R. Quintana, W. Wang ADG 2008
22. Problem
Our approach
Example
Future work
First case
Since α(s) and β(s) are linear forms on cos(s) and sin(s) this
question is converted into an algebraic problem in the same
way we have proceeded in the case point-ellipse, by performing
the change of variable
1 1 1 1
cos s = w+ , sin s = w−
2 w 2i w
and then using resultants to eliminate w.
We obtain a univariate polynomial of degree 60, Gε1 , whose
ε0
smallest positive real root is the square of d(ε0 , ε1 ).
Gε1 depends polynomially on the parameters of ε0 and ε1 .
ε0
F. Etayo, L. Gonzalez-Vega, G. R. Quintana, W. Wang ADG 2008
23. Problem
Our approach
Example
Future work
Second case
[α(s),β(s)]
d is determined by analyzing the implicit curve F[a,b] = 0 in
the region d ≥ 0 and s ∈ [0, 2π). In order to aply the algorithm
by L. G ONZALEZ -V EGA , I. N ÉCULA , Efficient topology
determination of implicitly defined algebraic plane curves.
Computer Aided Geometric Design, 19: 719-743, 2002, we use
the change of coordinates:
1 − u2 2u
cos s = 2
sin s =
1+u 1 + u2
[α(s),β(s)]
and the real algebraic plane curve F[a,b] = 0 is analyzed in
d ≥ 0, u ∈ R.
F. Etayo, L. Gonzalez-Vega, G. R. Quintana, W. Wang ADG 2008
24. Problem
Our approach
Example
Future work
Example
We consider ε0 and ε1 . ε0 with center (0, 0) and semi-axes of
length 3 and 2. ε1 centered in (2, −3) and with semi-axes,
parallel to the coordinate axes, of length 2 and 1.
F. Etayo, L. Gonzalez-Vega, G. R. Quintana, W. Wang ADG 2008
25. Problem
Our approach
Example
Future work
Example
F. Etayo, L. Gonzalez-Vega, G. R. Quintana, W. Wang ADG 2008
26. Problem
Our approach
Example
Future work
Example
F. Etayo, L. Gonzalez-Vega, G. R. Quintana, W. Wang ADG 2008
27. Problem
Our approach
Example
Future work
Example
In this case the minimum distance is given by computing the
real roots of the polynomial:
Gε1 (d) = k1 d4 (d12 −216d11 +...)(d2 −54d+1053)2 (d2 −52d+1700)2 (k2 d12 +k3 d11 +...)3
ε0
where ki are real numbers.
The non multiple factor of degree 12 is the one providing
the smallest and the biggest nonnegative real roots of
Gε1 (d). It is not still clear if this pattern appears in a
ε0
general way.
F. Etayo, L. Gonzalez-Vega, G. R. Quintana, W. Wang ADG 2008
28. Problem
Our approach
Example
Future work
Future work
Continue studying the continuous motion case.
Generalize to ellipsoids.
Non-coplanar ellipses.
Other conics.
F. Etayo, L. Gonzalez-Vega, G. R. Quintana, W. Wang ADG 2008
29. Problem
Our approach
Example
Future work
Thank you!
F. Etayo, L. Gonzalez-Vega, G. R. Quintana, W. Wang ADG 2008