Calculating reflected rayWritten by Paul BourkeJanuary 2000
This short note gives the equation for a reflected ray as used in many computer rendering applications, eg: ray tracing. Given a ray R_{i} incident at a point on a surface with normal N one wishes to determine the reflected ray from that point. The geometry and nomenclature is given in the following diagram.
The result is determined by straightforward geometry as follows where "." indicates the dot product and typically N and R_{1} are unit vectors.
Some obvious things to note at extreme cases. If R_{i} is parallel to the normal then R_{r} = N, that is, the reflected ray is in the opposite direction to the incident ray. If the incident ray is perpendicular to the normal then it is unaffected, R_{r} = R_{i}, this is a glancing ray. Note also that while the above diagram is in 2D, the equations hold for any dimension. |