function R=Quaternion2R(q);

ERR=10^-7;
if abs(norm(q)-1)<ERR
 [theta,w]=Quaternion2Euler(q);
 R=Euler2R(theta,w);
else
 R=[];
 fprintf('Error Euler2Quaternion: q is not a valid quaternion \n');
end;
