12 April, 2009

Reflecting a vector.

Let us assume:
angle = the angle of the incoming vector.
 wall = the angle of the "wall".

The formula for the reflection of an incoming vector in degrees is:
angle - (2 * (angle + (90 - wall)))
There is also a version in radians, which is very similar:
angle - (2 * (angle + ((PI / 2) - wall)))

No comments:

Post a Comment