Vector Reflection

Solution
Assuming that the reflection normal n is normalized: r = v - 2 * (v dot n) * n

Proof
Assuming n is normalized, v projected onto n is: vn = (v dot n) * n (see Point-Line Projection).

v reflected through n is then: +--+         o v                \          |  ascii       | \                |\         |  vector      | \  |            | \   |    |  notation:   | \ |            |  \  |    |              |              \ |            |_  \ |    |  start  end  | \|           | |  \|    |              |  +o+    --- +o|    |  o+  | n           |          -(v.n)n |    |              | |                 |    +--+                |                  |                    |                  |                o                    o                  o                                       |\        v-2(v.n)n / \                / \ | \  |            /   \   |          /   \   |         v-(v.n)n |  \  |           /     \  |         /     \  | |  \ |          /       \ |        /       \ |                  |    \|         /         \|       /         \     --- + |      - + --|    - + - o                  |                    |                 / |                   |                / |                  |                    |    v-2(v.n)n  /  | |                   |              /   |                                                     /                                                         +