function q = Euler(p, theta) % q = Euler(p, theta) is the quaternion for rotation about % point p with Euler angles theta = [tx,ty,tz] in degrees. c = cosd(theta/2); s = sind(theta/2); rx = qtn([c(1) s(1) 0 0]); ry = qtn([c(2) 0 s(2) 0]); rz = qtn([c(3) 0 0 s(3)]); r = rz*ry*rx; p = qtn([0 p]); q = r*p/r; end