I'm doing a raytracing exercise. I have a vector representing the normal of a surface at an intersection point, and a vector of the ray to the surface. How can I determine what the reflection will be?

In the below image, I have d and n. How can I get r?



Thanks.

$$r = d - 2 (d \cdot n) n$$

where $d \cdot n$ is the dot product, and
$n$ must be normalized.
