sustaining_gazes/matlab_version/pdm_generation/PDM_helpers/AxisAngle2Rot.m

12 lines
273 B
Mathematica
Raw Normal View History

2016-04-28 21:40:36 +02:00
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;