Skip to content
Mike Boyle edited this page Jul 25, 2019 · 4 revisions

This code provides an interface for using quaternions directly and efficiently in python, with good integration with numpy. The core of the code is written in C, which makes it very fast. Every effort is made to provide all the most common functions needed to manipulate quaternions.

Quaternions are collections of four numbers, much as complex numbers are collections of two numbers. Just as with complex numbers, quaternions can be added, subtracted, multiplied, and divided by each other. And in the same way, we can take exponentials and logarithms of quaternions. Their most common use is to describe rotations in three-dimensional space. This package encapsulates quaternions as objects in python and implements each of the operations described above, as well as many others.

The main documentation is in the form of docstrings in the package itself, but these are compiled by Read the Docs, and are available in browse-able form here. For example, in ipython (or recent versions of python itself) you might want to use tab-completion to see what functions are available by typing quaternion. (including the dot at the end), and then hitting tab. Or if you want more detail about a function, you might want to try entering something like quaternion.as_rotation_matrix? to see the docstring for that function.

Clone this wiki locally