Ray-sphere intersection: t-value of the intersection points

1.6k Views Asked by At

You have a sphere centered at [1,2,3] with radius 3, and a ray from [10,10,10] in the direction [-1,-1,-1]. Write the implicit equation for the sphere, the parametric equation for the ray, and compute the t-value of the intersection points.

I know that the equation of a sphere centered at $(x_{0}, y_{0}, z_{0})$ and with radius $r$ is $(x - x_{0})^{2} + (y - y_{0})^{2} + (z - z_{0})^{2} = 0$.

The implicit equation of this sphere is $(x - 1)^{2} + (y - 2)^{2} + (z - 3)^{2} = 3^{2} = 9$.

I also know that the parametric equation for a ray starting at the point $P(x_{0}, y_{0}, z_{0})$ and headed in the direction of the vector $\mathbb{v} = (v_{x}, y_{y}, y_{z})$ is given by $$x = x_{0} + v_{x}t$$ $$y = y_{0} + v_{y}t$$ $$z = z_{0} + v_{z}t$$

The parametric equation for this ray is $$x = 10 + (-1)t$$ $$y = 10 + (-1)t$$ $$z = 10 + (-1)t$$

How do I compute the $t$-value of the intersection points?

1

There are 1 best solutions below

0
On BEST ANSWER

From a comment from Martigan:

You have already done all the work! You just have to replace the parametric coordinates for the ray in the equation of the sphere, and you will have a equation of second order in t, which have 0, 1 or 2 solutions depending on the fact that the ray hits or not the sphere. You put back the roots in the parametric equation and you have the two points of intersection!

We know that for the ray, $x = y = z = 10 + (-1)t = 10 - t$.

The equation of the sphere is $$(x - 1)^{2} + (y - 2)^{2} + (z - 3)^{2} = 3^{2} = 9$$

Substitute the parametric coordinates for the ray into the equation of the sphere:

$\begin{align*} ((10 - t) - 1)^{2} + ((10 - t) - 2)^{2} + ((10 - t) - 3)^{2} &= 9 \\ (9 - t)^{2} + (8 - t)^{2} + (7 - t)^{2} &= 9 \\ (t^{2} - 18t + 81) + (t^{2} - 16t + 64) + (t^{2} - 14t + 49) &= 9 \\ 3t^{2} - 48t + 194 &= 9 \\ t &= \dfrac{1}{3}\left(24 \pm \sqrt{21}\right) \\ &= 6.4725\text{ and }9.5275 \end{align*}$