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

11 lines
273 B
Matlab

function [Rot] = AxisAngle2Rot(axisAngle)
theta = norm(axisAngle, 2);
nx = axisAngle / theta;
nx = [ 0 -nx(3) nx(2);
nx(3) 0 -nx(1);
-nx(2) nx(1) 0 ];
Rot = eye(3) + sin(theta) * nx + (1-cos(theta))*nx^2;