[Math] How to find the intersection of a parametric line and a sphere

3dmultivariable-calculusparametricvectors

For a homework assignment, one of the questions requires finding the points where a parametric line in vector form intersects with a sphere whose radius changes.

The line $r(s)$ is denoted by $\textbf{OP} + s\textbf{v}$, where $P = (x,y,z)$, and $\textbf{v} = \langle a,b,c\rangle$ (In the problem, there are actual values for the variables, but I'd like to look at it as a more general solution to help actually understand the problem).

The sphere has a radius $t$, which grows as $t$ increases.

The part of the problem that I'm having trouble understanding is how to find the points of intersection between the sphere and $r(s)$. I know that all intersections will fall on the line, but I'd like to find which value of $t$ will result in the first intersection, when $r(s)$ is tangent to the sphere's surface. When I visualize a similar problem in $\mathbb{R}^2$, it becomes easier to see when a circle intersects a line, but I have trouble finding out how to apply this in $\mathbb{R}^3$, and with a line that is parametric.

Any nudges in the right direction would greatly help.

Best Answer

When the line $r(s)=P+sv$ interests the sphere, you will have

$|r(s)-C|^2=R^2$

where $C$ is the center of the sphere and R is the sphere's radius.

So, you will get a quadratic equation of $s$, from which you can obtain either no real roots (which means the line does not intersect the sphere), 1 real root (which means the line is tangent to the sphere) or two real roots (which means the line intersects the sphere at two locations).

Related Question