Search code examples
mathvectorreflectionanglecalculation

How to find reflection vector when the object doesn't sit on an axis?


How do I calculate the reflection vector to this problem? Using the formula r = v - 2 (v.n)n I can get the reflection when the object is sat on the x or y axis however when using this formula when it isnt seems to give strange results. Any help would be greatly appreciated.

Example of the problem


Solution

  • The normal vector n needs to be normalized.

    In your example, n should be (1/sqrt(2), 1/sqrt(2)).