open source pkg v1
This commit is contained in:
11
pkg/OpenFace/matlab_version/PDM_helpers/Rot2AxisAngle.m
Normal file
11
pkg/OpenFace/matlab_version/PDM_helpers/Rot2AxisAngle.m
Normal file
@@ -0,0 +1,11 @@
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user