How to get a reflection vector? 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.

I was trying to understand how to calculate the reflection vector and found these answers. I couldn't understand them easily, so I took my time to do it myself, the good thing is that I can now detail it in an ELI5 fashion!
I did develop the formula using the 3 steps shown in the graphic. I describe them bellow.

So, the initial situation is $\vec{a}$ pointing toward a plane. Then we have the normal $\vec{n}$ of unit lenght and we would like to find $\vec{b}$
So, the first step is using the dot product to get a vertical vector that will be used in step 2.
With step 1 my partial formula is: $2\times\left(a+(-\vec{a})\cdot\vec{n}\times{}n\right)$
mind the change of sign of $\vec{a}$ above, we "flipped" it
Then in step 2, I can write: $-\vec{a}+2\times\left(a+(-\vec{a})\cdot\vec{n}\times{}n\right)$
Now, I can distribute:
$-\vec{a}+2\times{}\vec{a}+2\times(-\vec{a})\cdot\vec{n}\times{}n$
Then simplify, and I end up with:
$\vec{a}+2\times(-\vec{a})\cdot\vec{n}\times{}n$
If you negate a vector in the dot product, you negate the result of the dot product.
$\vec{a}\cdot\vec{b}=-(-\vec{a})\cdot\vec{b}$
That means that I can rewrite the formula like this:
$\vec{a}-2\times(\vec{a})\cdot\vec{n}\times{}n$
