I am not familiar with this area, but see, e.g. https://link.springer.com/book/10.1007/978-3-0348-0622-0
There are also these notes: https://www.geometrictools.com/Documentation/Quaternions.pdf
There are also these notes: https://www.geometrictools.com/Documentation/Quaternions.pdf