Originally Posted by

**HallsofIvy** A line, in three dimensions, that includes the point $\displaystyle (x_0, y_0, z_0)$ and points in the direction of vector $\displaystyle <A, B, C>$ can be written in parametric equations as $\displaystyle x= At+ x_0$, $\displaystyle y= Bt+ y_0$, and $\displaystyle z= Ct+ z_0$. The line from the eye point, (13, -3.5, 29) in direction <-2, -3, -16> has equations $\displaystyle x= -2t+ 13$, $\displaystyle y= -3t- 3.5$, and $\displaystyle z= -16t+ 29$.

Replace x, y, and z in the equation of the sphere with those and you get one quadratic equation for t. Solve for t, then use the parametric equations of the line to find the corresponding x, y, and z values.

A quadratic equation may have no real solution, one (double) solution, or two solutions. Those correspond to the cases where the line misses the sphere entirely, is tangent to the sphere, or crosses through the sphere.

Since the given point is inside the sphere, there will have to be two solutions, one with t negative and one with t positive. Since the parametric equations were set up with t multiplying the direction vector, the correct solution will be the one for the positive t.