How do I find the outward unit vectors which are normal to the surface of the sphere at the intersection points of the ray and the sphere?

814 Views Asked by At

Consider the surface of the sphere given by the equation $$(x − 3)^2 + (y − 4)^2 + z^2 = 25.$$ You shoot a ray from the point $(8, 4, 0)$ along the vector $v = \langle1, 0, 1\rangle$.

What are the outward unit vectors normal to the surface of the sphere at the intersection points of the ray and the sphere?

I found the two intersection points, which are $(8, 4, 0)$ and $(3, 4, −5)$. The answer to this question are the vectors $\langle 1, 0, 0\rangle$ and $\langle 0, 0, -1\rangle$, but I don't know how they got here from the two intersection points.

2

There are 2 best solutions below

0
On

$$\nabla ((x − 3)^2 + (y − 4)^2 + z^2 - 25)$$ $$=[2(x-3),2(y-4),2z]$$ Substitute the coordinates of the points of intersection into this expression. Remove the surplus factor of "2" from the vectors and then divide each vector by its norm.

0
On

Let's go through this step by step. I'll use notation $(x, y, z) = \left[\begin{matrix} x & y & z \end{matrix} \right]^T = \left[\begin{matrix} x \\ y \\ z \end{matrix}\right]$ for vectors for brevity.

You have $$(x - 3)^2 + (y - 4)^2 + (z - 0)^2 = 25$$ which describes a sphere of radius $r = 5$ centered at $\vec{c} = (x_c, y_c, z_c) = (3, 4, 0)$: $$(x - x_c)^2 + (y - y_c)^2 + (z - z_c)^2 = r^2$$ If we use $\vec{p} = (x, y, z)$, we can write this in vector form as $$(\vec{p} - \vec{c}) \cdot (\vec{p} - \vec{c}) = r^2$$

You also have a ray that starts at $\vec{p}_0 = (x_0, y_0, z_0) = (8, 4, 0)$, in direction $\vec{v} = (x_v, y_v, z_v) = (1, 0, 1)$. As a vector-valued function, we can parametrize the ray using $0 \le t \in \mathbb{R}$, $$\vec{p}(t) = \vec{p}_0 + t \vec{v}$$ or in Cartesian coordinate form, $$\left\lbrace ~ \begin{aligned} x(t) &= x_0 + t x_v \\ y(t) &= y_0 + t y_v \\ z(t) &= z_0 + t z_v \\ \end{aligned} \right.$$

The intersection occurs at when $\vec{p}$ fulfills the first equation, using $\vec{p}(t)$ for $\vec{p}$: $$\Bigr((\vec{p}_0 + t \vec{v}) - \vec{c}\Bigr) \cdot \Bigr((\vec{p}_0 + t \vec{v}) - \vec{c}\Bigr) = r^2$$ or, equivalently in Cartesian coordinate form, $$(x_0 + t x_v - x_c)^2 + (y_0 + t y_v - y_c)^2 + (z_0 + t z_v - z_c)^2 = r^2$$ Solving for $0 \le t \in \mathbb{R}$ tells you if and where ($\vec{p}(t)$) the ray and the sphere intersect. You discard solutions where $t \lt 0$, because they occur "before" the starting point of the ray. If $\lVert\vec{v}\rVert = 1$, then $t$ is also the distance from the starting point to the intersection, but generally the distance is $t\lVert\vec{v}\rVert$, i.e. in units of direction vector Euclidean length.

In this case, the two solutions are $t = 0$ corresponding to $\vec{p}(0) = (8, 4, 0)$ and $t = -5$ corresponding to $\vec{p}(-5) = (3, 4, -5)$. This means that the starting position of the ray intersects the sphere, as does $t = -5$. However, $t = -5$ is in the opposite direction of the ray, so whether you wish to consider that case or not depends on the context. Usually $t = -5$ would not be considered.

As amd commented, every point on an unit sphere is also the normal vector on that sphere. More generally, given point $\vec{p}$ at distance $r$ from center of sphere $\vec{c}$, the unit normal vector is $$\hat{n} = \frac{\vec{p} - \vec{c}}{r} = \frac{\vec{p} - \vec{c}}{\left\lVert \vec{p} - \vec{c} \right\rVert}$$

In OP's case, the points are $(8, 4, 0)$ and $(3, 4, -5)$, with the sphere radius $r = 5$, and center $\vec{c} = (3, 4, 0)$. Applying above we get $$\hat{n}_{(8, 4, 0)} = \left( \frac{8-3}{5}, \frac{4-4}{5}, \frac{0-0}{5} \right) = \left( 1, 0, 0 \right)$$ and $$\hat{n}_{(3, 4, -5)} = \left( \frac{3-3}{5}, \frac{4-4}{5}, \frac{0--5}{5} \right) = \left( 0, 0, 1 \right)$$