Quaternions
tldr: Simply explained without demonstrations:
Quaternions are hypercomplex numbers of the form<p>w + xi + yj + zk<p>Where w, x, y, and z are real and i^2 = j^2 = k^2 = -1 and ij = k, ji = -k, jk = i, kj = -i, ki = j, ik = -j.<p>Being u = (x, y, z) = xi + yj + zk a unitary vector, it is possible rotate any vector q by an angle theta around u by doing:<p>pqp&#x27;<p>where p = cos(theta&#x2F;2) + sin(theta&#x2F;2)u and p&#x27; = cos(theta&#x2F;2) - sin(theta&#x2F;2)u .