2
$\begingroup$

How can I find minimum distance between point and sphere ?

sphere properties :

position of center a,b,c redius of the sphere R

point properties

position x,y,z

  • 0
    @DonAntonio I sort of see your point but if a simple question asks for a simple answer, you might as well give that simple answer, right?2012-11-25

1 Answers 1

4

You essentially just take the distance between the point and the center of the sphere and substract the distance from the center of the sphere to its surface which happens to be the Radius.

$\sqrt{(a-x)^2+(b-y)^2+(c-z)^2}-R$

where $a,b,c$ are the center of the sphere, $x,y,z$ are the cartesian coordinates of your point and $R$ is the radius of your sphere.
If the point lies within the sphere, by this formula you'd get a negative value. In that case, just do $|\sqrt{(a-x)^2+(b-y)^2+(c-z)^2}-R|$ In Vectornotation: $|(||\left( \begin{array}{c} a-x \\ b-y \\ c-z \end{array} \right)||_2-R)|$

  • 0
    If $y$ou alread$y$ wrote an answer, wh$y$ won't you add at least a hint on why this works? Something about euclidean geometry, tangent plane to a sphere and stuff?2012-11-25