# Expressing a reflected ray at a point as a function of the incoming ray and the normal to the surface at that point

Said L the incoming ray (at a point $P$). $R$ is the reflected ray. $N$ is the normal to the surface at the point $P$. $\alpha$ is the angle between $N$ and $L$ (and $N$ and $R$ also). It is assumed a smooth surface (like a plane). $P_{R1}$ is the projection of the vector $R$ on the plane. $R_2$ is the vector that joins the vector $R$ and $P_{R1}$. Now you have,

$R= P_{R1} + R_2$ (sum of vectors)

$P_{R1} = -L+R_2$

Thus: $R=2R_2-L$

Now, exploiting the property of dot product (namely scalar product)

$R_2 = (N\cdot L)/|N|$ (because $R_2$ is $L\cos(\alpha)$ because is the projection of $L$ on $N$)

where $N\cdot L$ is the dot product and $|N|$ is the magnitude (the module) of vector $N$. But the vector $N$ is the normal that typically has $|N|=1$ Thus:

$R = 2(N\cdot L)-L$

But my book (3D Computer Graphics, Alan Watt) tells that:

$R_2 = (N\cdot L)N$

Rather for me is:

$R_2=(N\cdot L)/|N| = N\cdot L$ (because $|N|=1$)

I don't understand this point.

• If R2 is a vector, it can't be equal to NL which is a scalar. Aug 24, 2016 at 14:51

$N \cdot L$ is the scalar length of the projection of $L$ on $N$ (assuming $|N|=1$).
$(N \cdot L)N$ is the actual vector with the length of $N \cdot L$ in the direction of $N$.
There is often a confusion when people say "projection of this on that" whether they mean just its length, or the actual vector resulting from the projection. In this case you want to combine it with another vector, so you need the vector version. The correct reflection formula is thus: $$R = 2(N \cdot L)N - L$$