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

  • 4
    That would be the distance between the sphere's center and the point, minus the radius?2012-11-25
  • 0
    Calculate the distance between the point and the sphere's center and substract from here the sphere's radius (can you see why this is so?)2012-11-25
  • 0
    $\left\vert\sqrt{(a-x)^2+(b-y)^2+(c-z)^2}-R\right\vert$2012-11-25
  • 1
    Hehe...within 2 minutes, 3 answers that look different yet they convey exactly the same. Ah, I love it when we mathematicians drive nuts non-mathematicians.2012-11-25
  • 1
    Well, one of you three ought to post a real answer!2012-11-25
  • 0
    Oh I didn't even read the comments here. I'm not quite familiar with how stackexchange users are expected to handle questions like this. Why wouldn't you just answer in form of an answer rather than write a comment?2012-11-25
  • 0
    It's way too short and elementary for an answer, I guess...2012-11-25
  • 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 you already wrote an answer, why 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