Formal definition:

Given points P0, P1 and a plane V.p = D for all p

find point Pm on the plane such that is a reflection point of P0 and P1

Solution:

1. find the reflection of point P1, denote as P1′

P1′ = P1 – (2*(P1.V – D)/V.V) V (see [1])

here we simplify P1′.V, we will use this result later

P1′.V = P1.V – (2*(P1.V – D)/V.V) V.V

= 2*D – P1.V — [2]

2. Pm is on the line passing through P0 and P1′

Pm = (1-r) P0 + r P1′ for some r . 0 < r < 1 — [3]

Pm = P0 + r (P1′-P0)

Pm.V = P0.V + (P1′.V – P0.V) r

r = (Pm.V – P0.V) / (2*D – P1.V – P0.V) (by [2])

= (D – P0.V) / (2*D – P1.V – P0.V) (Pm on plane <=> Pm.V = D)

let K0 = D – P0.V

let K1 = D – P1.V

r = K0 / (K0 + K1)

Note: 0 < r < 1 <=> equivalently sign(K0) = sign(K1)

substitute r into [3]

Pm = (1- K0/(K0+K1)) P0 + (K0/(K0+K1)) P1′

= (K1/(K0+K1)) P0 + (K0/(K0+K1)) P1′

= (K1/(K0+K1)) P0 + (K0/(K0+K1)) (P1 + (2*K1/V.V) V ) — [1]

= (K1/(K0+K1)) P0 + (K0/(K0+K1)) P1 + 2*(K0*K1/(K0+K1))/V.V V

Therefore,

Pm = (K1/(K0+K1)) P0 + (K0/(K0+K1)) P1 + 2*(K0*K1/(K0+K1))/V.V V

where

K0 = D – P0.V

K1 = D – P1.V

And valid on when sign(K0) = sign(K1)

[1] http://en.wikipedia.org/wiki/Reflection_(mathematics)#Reflection_through_a_hyperplane_in_n_dimensions