UWB-Algorithm/UWBAnimationShow/Quaternions/euler2rotMat.m

15 lines
508 B
Matlab

function R = euler2rotMat(phi, theta, psi)
R(1,1,:) = cos(psi).*cos(theta);
R(1,2,:) = -sin(psi).*cos(phi) + cos(psi).*sin(theta).*sin(phi);
R(1,3,:) = sin(psi).*sin(phi) + cos(psi).*sin(theta).*cos(phi);
R(2,1,:) = sin(psi).*cos(theta);
R(2,2,:) = cos(psi).*cos(phi) + sin(psi).*sin(theta).*sin(phi);
R(2,3,:) = -cos(psi).*sin(phi) + sin(psi).*sin(theta).*cos(phi);
R(3,1,:) = -sin(theta);
R(3,2,:) = cos(theta).*sin(phi);
R(3,3,:) = cos(theta).*cos(phi);
end