tldr: Simply explained without demonstrations:
Quaternions are hypercomplex numbers of the form
w + xi + yj + zk
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.
Being u = (x, y, z) = xi + yj + zk a unitary vector parallel to a rotation axis, it is possible rotate any vector q with a theta arc around u by doing:
pqp'
where p = cos(theta/2) + sin(theta/2)u and p' = cos(theta/2) - sin(theta/2)u .
w + xi + yj + zk
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.
Being u = (x, y, z) = xi + yj + zk a unitary vector parallel to a rotation axis, it is possible rotate any vector q with a theta arc around u by doing:
pqp'
where p = cos(theta/2) + sin(theta/2)u and p' = cos(theta/2) - sin(theta/2)u .