The Accurate Method for Computing the Minimum Distance between a Point and an Elliptical Torus

: We present an accurate method to compute the minimum distance between a point and an elliptical torus, which is called the orthogonal projection problem. The basic idea is to transform a geometric problem into ﬁnding the unique real solution of a quartic equation, which is ﬁt for orthogonal projection of a point onto the elliptical torus. Firstly, we discuss the corresponding orthogonal projection of a point onto the elliptical torus for test points at six different spatial positions. Secondly, we discuss the same problem for test points on three special positions, e


Introduction
In this paper, we discuss how to compute the minimum distance between a point and a spatial parametric surface and to return the nearest point on the surface, as well as its corresponding parameter, which is also called the point projection problem (the point inversion problem) of a spatial parametric surface.This problem is very interesting due to its importance in geometric modeling, computer graphics and computer vision [1].Both projection and inversion are essential for interactively selecting surfaces [1,2], for the surface fitting problem [1,2] and for the reconstructing surfaces problem [3][4][5].It is also a key issue in the ICP (iterative closest point) algorithm for the shape and rendering of solid models with boundary representation [6] and projecting of a space curve onto a surface for curve surface design [7].Many algorithms have been developed by using various techniques, including turning the problem into solving the root problem of polynomial equations, geometric methods, subdivision methods and the circular clipping algorithm.For more details, see  and the references therein.The elliptical torus in the geodetic science, machinery and machine, biochemistry and biophysics, colloids and interfaces, antennas and propagation and other subjects has certain applications [31][32][33][34][35][36].
In the various methods mentioned above, all of the iterative processes can produce one iterative solution.Different from the above methods, we consider the special situation in which the test point generates countless corresponding solutions for the orthogonal projection problem.We then present an accurate method for computing the minimum distance between a point and an elliptical torus, which is called the orthogonal projection problem.The basic idea is to transform a geometric problem into finding the unique real solution of a quartic equation, which is fit for the orthogonal projection of a point onto the elliptical torus.Firstly, we will discuss the corresponding orthogonal projection of a point onto the elliptical torus for test points at six different spatial positions.Secondly, we will discuss the same problem for test points at three special positions, e.g., points at the z-axis, the long axis and the minor axis, respectively.

The Accurate Method for Computing the Minimum Distance between a Point and an Elliptical Torus
The parametric equation of an elliptical torus Γ can be defined as: where R > m > n > 0. The corresponding implicit function equation of Equation ( 1) is: where R > m > n > 0. We assume that the test point is (x 0 , y 0 , z 0 ).Orthogonally projecting the test point (x 0 , y 0 , z 0 ) onto the x-y plane, the corresponding projecting point on the x-y plane is (x 0 , y 0 , 0).It is not difficult to know that the corresponding orthogonal projection point for the minimum distance between point (x 0 , y 0 , 0) and the major planar circle: , 0), which is set as the datum point.The plane determined by the z-axis and the line that passes through the point (0, 0, 0) and the test point (x 0 , y 0 , z 0 ) is: It is not difficult to find that the plane Equation ( 4) is perpendicular to the horizontal tangent vector, which is determined by datum point (x 1 , y 1 , 0) at the major planar circle Equation (3).Therefore, computing the minimum distance between the test point (x 0 , y 0 , z 0 ) and the elliptical torus Γ is equivalent to computing the minimum distance between the test point (x 0 , y 0 , z 0 ) and the planar ellipse: The corresponding parametric equation of the planar ellipse Equation ( 5) is: x 0 (R + m cos(u)) x 2 0 + y 2 0 y = y 0 (R + m cos(u)) Therefore, the problem of finding the minimum distance between the test point (x 0 , y 0 , z 0 ) and the elliptical torus Γ is naturally transformed into finding the minimum distance between the test point (x 0 , y 0 , z 0 ) and the planar ellipse Equation (6).The tangent vector at the planar ellipse Equation ( 6) is: x 2 0 + y 2 0 , −y 0 m sin(u) The vector determined by test point (x 0 , y 0 , z 0 ) and one point on the ellipse is: The inner product of the two vectors The left side of the Equation ( 9) can be transformed into the form: Let cos(u) = t; Equation ( 10) can be expressed as the form: Squaring both sides of the Equation ( 11) and simplifying, we get: where The simplified Equation ( 12) is: where , then the Equation ( 13) can further be simplified as: where Lemma 1. Equation ( 14) can be factored into: where λ, β, γ are three parameters to be determined by p, q, r.
Proof.We assume that the left-hand side of Equation ( 15) has four roots Y 1 , Y 2 , Y 3 , Y 4 , and then, we have ) must generate a quadratic trinomial in which the coefficient of the first term is one, we will obtain the right side of the equation in Equation (15).
Theorem 1.The two real roots of the Equation ( 15) are: Proof.From Lemma 1, Formula (15) can be expressed in the following way, Comparing coefficients in both sides of Formula ( 16), we get: Combining Equation (16) with Equation ( 17), it is not difficult to find that: Substituting Formula (18) into the third formula of Equation ( 17) and simplifying it, we get: We know that the following cubic equation for x: has only one real root: and a pair of complex roots: . It is easy to know that a pair of complex roots x 2 and x 3 are not satisfied for Formula (19), because there is no imaginary root fit for the orthogonal projection point, so we have to abandon them.Based on Equation (20), the real root of Equation ( 19) is: and: 1 3 and A = 2p, B = p 2 − 4r, C = −q 2 .Substituting these results into the right-hand side of Formula (15), we get the four roots Y 1 , Y 2 , Y 3 , Y 4 , namely, two real roots: and a pair of complex roots According to the result of Theorem 1 and the corresponding four roots of Formula ( 13), there are two real roots, and a pair of complex roots: respectively.We discard a pair of complex roots t 21 , t 22 because Equation (19) has two real roots . Therefore, there are four real root solutions for t 1 , but only two of them are satisfied with the conditions by the point projection problem.By verification, if x 2 0 + y 2 0 > R, then the solution for Equation ( 13) is: if x 2 0 + y 2 0 < R, then the solution for Equation ( 13) is: if x 2 0 + y 2 0 = R, then the solution for Equation ( 13) is t 1 = 0. Furthermore, we have six cases with different test points (see Figure 1): (1) If x 2 0 + y 2 0 > R, z 0 > 0, then the corresponding orthogonal projection point (x 2 , y 2 , z 2 ) is: (2) If x 2 0 + y 2 0 > R, z 0 < 0, then the corresponding orthogonal projection point (x 2 , y 2 , z 2 ) is: (5) If x 2 0 + y 2 0 = R, z 0 > 0, then the corresponding orthogonal projection point (x 2 , y 2 , z 2 ) is: Graph of orthogonal projection with test points given by six cases.
Remark 1.Because of the errors due to the floating-point numbers in the computer's arithmetic operation, in the program implementation, we must consider the case in which the roots t 1 = t 11 , t 1 = t 12 are complex roots.The specific approach is as follows: because , where λ 0r , λ 0i denotes the real part and the imaginary part of complex number λ 0 , respectively.Let , where s r , s i represent the real part and imaginary part of complex number λ 2 − 4β, respectively.Therefore: 4 sin(θ 2 /2)i, where ).In the process of computing the real roots, we delete the imaginary part of the roots Now, we begin to deal with the first special case in which the test point is on the z-axis, namely test point is (0, 0, z 0 ).We compute the corresponding orthogonal projection point (x 2 , y 2 , z 2 ) on the specific planar ellipse Because x 0 = y 0 = 0, this special case is satisfied with x 2 0 + y 2 0 < R, then the corresponding parameter value is Based on this parameter value, we present the corresponding orthogonal projection point (x 2 , y 2 , z 2 ) in the following with different test points on the z-axis of the elliptical torus (see Figure 2).
We turn to discuss the second special case in which test point (x 0 , y 0 , z 0 ) is on the long axis, and its parametric equation is We then compute the corresponding orthogonal projection point (x 2 , y 2 , z 2 ) in the following five cases with different test points on the planar ellipse (see Figure 3).( so the corresponding orthogonal projection points (x 2 , y 2 , z 2 ) are expressed as: and: (3) If s = 0, then the corresponding orthogonal projection points (x 2 , y 2 , z 2 ) are expressed as: and: Therefore, the corresponding orthogonal projection points (x 2 , y 2 , z 2 ) are expressed as: and: Remark 2. When the test point (x 0 , y 0 , z 0 ) and parameter s are determined, the left-hand side (x, y, z) of Equation ( 30) is also uniquely determined.In the five cases above, the new test point (x 0 , y 0 , z 0 ) in Equations ( 31)-( 38) is equal to (x, y, z) in the left side of Equation (30), rather than the original test point (x 0 , y 0 , z 0 ).We remind the readers to pay attention to our explanation here with respect to different test points in Equations ( 30)-( 38).
We start to analyze the third special case in which the test point (x 0 , y 0 , z 0 ) is on the minor axis and its parametric equation is: We compute the corresponding orthogonal projection point (x 2 , y 2 , z 2 ) on the planar ellipse: (1) If s > 0, then the corresponding orthogonal projection point (x 2 , y 2 , z 2 ) is: (2) If s < 0, then the corresponding orthogonal projection point (x 2 , y 2 , z 2 ) is expressed as: (3) If s = 0, then the corresponding orthogonal projection points (x 2 , y 2 , z 2 ) are expressed as:

Figure 2 .
Figure 2. Graph of orthogonal projection with test points given by three cases.

Figure 3 .
Figure 3. Graph of orthogonal projection with test points given by five cases.