%%%%%%%%%%%%%%%%%%%%%%%%%%%% Geodesic Ray Matrix %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % RAYMAT % Usage: RAYMAT(seg) % Inputs: seg - a segment [x y] % % Output: a matrix L used to construct the ray from P to Q function L = raymat(seg) x = seg(1); y = seg(2); u = sqrt(1-abs(x)^2); % a normalizing factor v = (y-x)/(1-conj(x)*y); % an image of y w = conj(sqrt(v/abs(v))); % rotation factor a = w/u; b = -x*a; L = [conj(a) -b; -conj(b) a]; % inverse of the matrix [a b; conj(b) conj(a)]