# Min,max distances between point and spherical surface

I have a spherical surface defined by four points on an ellipsoid centered at (0,0,0). That is, the four points define a bounding box projected onto the ellipsoid. I have another point, P at some location (x,y,z). I need to find the minimum and maximum distances between this point and the surface.

The equation of an ellipsoid is given by:

$r^2=\frac{x^2}{A} + \frac{y^2}{B} + \frac{z^2}{C}$

Here's a terribly drawn picture that might help:

-
add comment

## 1 Answer

If $P$ has coordinates $(a,b,c)$ and $Q(x,y,z)$ is a point on the surface, then

$$PQ^2=(x-a)^2+ (y-b)^2+(z-c)^2$$

The problem asks you to minimize/maximize this function, on your domain. Inside the domain, this is a standard Lagrange Multipliers problem, and then you can take care of the boundary...

-
Could you please elaborate on some of this? I read up a bit on Lagrange Multipliers; I get that I want to constrain the solution. I don't really know how to go from four points on the surface to constraints defining the projected bounding box. –  Pris Oct 25 '12 at 17:01
It is not clear to me what the projected box is, my guess/understanding is that it is the intersection between the planes passing through two points and the centre and the elipsoid...So, find the equation of the plane passing through two neighbouring corners of the box and the origin, and intersect that plane with the elipse... –  N. S. Oct 25 '12 at 21:15
add comment