# 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:

-

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$$