Can segment sphere intersection be view as point cylinder intersection

19 Views Asked by At

If we have a sphere with origin at $p$ and radius $r$, and a segment with endpoints $a$ and $b$. And we want to check if they intersect. Would it be correct to assume that we could also view this as checking whether a point $p$ lies inside a cylinder defined by endpoints $a$, $b$ and radius $r$?

1

There are 1 best solutions below

2
On BEST ANSWER

Consider this example:

\begin{align} p &= (0,0,0),\\ r &= 1,\\ a &= (0.8,0,0),\\ b &= (2,0,0). \end{align}

Here $a$ is inside the sphere and $b$ is outside, so there is definitely an intersection, but $p$ is not inside the cylinder.

But if you add a half-sphere of radius $r$ onto each end of the cylinder, then $p$ is inside that combined region if and only if the segment $ab$ intersects the interior of the sphere.