%ROTX   Rotation about x
% Function calculates incremental rotations about x y and z axes required
% to transform frame T1 to T2.  Rotations are calculated by forming dot
% products between  old and new pairs of orthogonal axes to get component
% of rotation perpendicular to the pair of axes.
%
% Syntax:  dO = twitch(T1, T2)
%
% Inputs:
%    T1 - frame 2
%    T2 - frame 2
%
% Outputs:
%    dO - incremental rotation
%
% See also: INVROTAXIS

% Author: Travis Hydzik
% Last revision: 19 October 2004

function dO = twitch(T1, T2)
    
    dO = [ T1(1:3,3)'*T2(1:3,2)    % dtheta_x
           T1(1:3,1)'*T2(1:3,3)    % dtheta_y
           T1(1:3,2)'*T2(1:3,1) ]; % dtheta_z