function r = rot(theta, v) % rot r = rot(theta,v) is the quaternion (qtn) for % rotation of angle theta, in degrees, about axis v. v = v/norm(v); r = qtn(cosd(theta), sind(theta)*v); end