# General Formula For Reflection Direction

1. Sep 5, 2010

An Example Scenario:

A particle moves at 32° and collides with a wall. This wall is rectangular in nature, which means that there is both horizontal and vertical sides.

On a horizontal tangent, it would work like this (sorry for ugly, not-to-scale diagrams):

[PLAIN]http://img198.imageshack.us/img198/7808/questionsc.jpg [Broken]
(reflects at 148°)

However, on a vertical tangent it would reflect like this:

[PLAIN]http://img808.imageshack.us/img808/2064/question2.png [Broken]
(reflects at 328°)

This means that:
• On horizontal tangent: reflectionDirection = 180-incidenceDirection
• On vertical tangent: reflectionDirection = 360-incidenceDirection

It's lame to have two different formulas, so is there a general formula for the reflectionDirection that works with both vertical and horizontal tangents? It's fine if it uses radians instead of degrees.

Last edited by a moderator: May 4, 2017
2. Sep 5, 2010

If the incoming angle is A, and B is an angle normal to the wall, then the reflected angle C is given by C = B - A.

3. Sep 6, 2010

Thanks, but that was not what I was looking for.

In case someone else needs to know, the general formula is:

C = 180+2B-A

Where A is the direction of incidence, B is the direction of tangent (0 if horizontal, 90 if vertical) and C is the direction of reflection.

4. Sep 6, 2010