%%%%%%%%%%%%%%%%%%%%% Reflection Matrix %%%%%%%%%%%%%%%%%%%%% % % REFLMAT % Usage: REFLMAT(seg) % Inputs: seg = [x y] - x,y are points inside or on the unit circle % % The matrix effecting the reflection in the hyperbolic % geodesic connecting x and y is constructed. % to effect the reflection act on a complect number via L and then % conjugate the result function L = reflmat(seg) I = sqrt(-1); x = seg(1); y = seg(2); m = (x+y)/2; d = I*(x-y)/2; w = 2*real(m*conj(d)); if (w < 0) d = -d; w = -w; end; u = abs(m); v = abs(d); ti = w/(v^2+1-u^2); tr = 1/sqrt(v^2*(1+ti^2)); ri = ti*tr; cr = ri*m +tr*d; a = -I*conj(cr); b = I*ri; L = [a b; conj(b) conj(a)];