A line, in three dimensions, that includes the point

and points in the direction of vector

can be written in parametric equations as

,

, and

. The line from the eye point, (13, -3.5, 29) in direction <-2, -3, -16> has equations

,

, and

.

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.