Saturday, April 07, 2007

Reflection math



Reflection
If we are given the direction vector of the incident ray and normal vector of the surface wherethe ray hits, how can we obtain the direction of the reflected ray.In this system the angle of incidence is equal to the angle of reflection.Let the incident ray vector be 'a' and reflected ray vector be 'r'.a is resolved into m and e horizontally and vertically. because of symmetry r is also resolved intothe same components.
From the figure e=a-m ; r = e- m; or r = a-2m
but m is the projection of a on n; ie, m = (a.n / n)*(unit vector n)
or m = [a.(unit vector n)]*unit vector n
putting this value of m in equation r = a-2m we will get the result.