sustaining_gazes/matlab_version/pdm_generation/PDM_helpers/Rot2AxisAngle.m
2016-04-28 15:40:36 -04:00

11 lines
318 B
Matlab

function [ axisAngle ] = Rot2AxisAngle( Rot )
%ROT2AXISANGLE Summary of this function goes here
% Detailed explanation goes here
theta = acos((trace(Rot) - 1) / 2);
vec = 1.0/(2*sin(theta));
vec = vec * [Rot(3,2) - Rot(2,3), Rot(1,3) - Rot(3,1), Rot(2,1) - Rot(1,2)];
axisAngle = vec * theta;
end