
function Y = strCayley(v)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Computes the Y-matrix for the Cayley map
% at the coord point v
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% Initialize variables

Y      = zeros(3,3) ;
vcross = zeros(3,3) ;

% Compute skew matrix [vx]

vcross(3,2) =  v(1) ;
vcross(2,3) = -v(1) ;
vcross(1,3) =  v(2) ;
vcross(3,1) = -v(2) ;
vcross(2,1) =  v(3) ;
vcross(1,2) = -v(3) ;

% Use explicit formula for Y-matrix

Y = eye(3) - 0.5*vcross + 0.25*v*v' ;

