Rotation in three dimensions

This application calculates the three-dimensional rotation of a point p around an arbitrary axis. In three dimensions, the rotation axis can be determined from a directed line or a direction vector v and a (fixed) point f which v goes through. The rotation is calculated using quaternion as follows. Let P and F be (pure imaginary) quaternions with p and f as vector parts, θ be the angle of rotation (positive for counterclockwise rotation), and unit quaternion of v defined as u=cos(θ2)+sin(θ2)vv then 3D rotation is calculated from the formula F+u(PF)u1 Note that for unit quaternion u1=u, the quaternion conjugate of u.

3D Rotation Calculator