# Where does $\cos(pi/2)$ and $\sin(pi/2)$ come from in quaternion rotation? Can you provide a simple unit quaternion rotation example?

I have seen many methods of rotation such as $$p' = qpq^{-1}$$ and $$q = \cos (pi/2),v \sin (pi/2)$$ , but I became slightly confused by how a unit quaternion is performed around a vector line.

• Have you looked at the wikipedia article Quaternions and spacial rotation? What is your confusion? – Somos Apr 10 at 14:03
• Yes, but I do not really understand what p' = qpq^-1 actually represents when we perform a rotation. – Guy Gershon Apr 11 at 10:53
• The article states "it can be shown that the desired rotation can be applied to an ordinary vector p ... considered as a quaternion with a real coordinate equal to zero, by evaluating the conjugation of p by q: p' = qp$q^{-1}$ ... where p' is the new position vector of the point after rotation." What part of that do you not understand? – Somos Apr 11 at 12:03
• Where the inverse quaternion comes into play in the equation (q^-1). – Guy Gershon Apr 11 at 12:18
• Because multiplication by q and $q^{-1}$ leaves the real part of quaternions fixed. – Somos Apr 11 at 13:04