Convert rotation matrix to angle-vector form
[THETA,V] = tr2angvec(R) [THETA,V] = tr2angvec(T)
[THETA,V] = TR2ANGVEC(R) converts an orthonormal rotation matrix R into a rotation of THETA (1x1) about the axis V (1x3).
[THETA,V] = TR2ANGVEC(T) as above but uses the rotational part of the homogeneous transform T.
If R (3x3xK) or T (4x4xK) represent a sequence then THETA (Kx1)is a vector of angles for corresponding elements of the sequence and V (Kx3) are the corresponding axes, one per row.
If no output arguments are specified the result is displayed.
This algorithm is from Paul 1981, other solutions are possible using eigenvectors or Rodriguez formula.