A Python library for representing and manipulating quaternions, designed for 3D animation and geometry.
pyquaternion is a Python library for representing and manipulating quaternions, which are mathematical objects used to describe rotations in 3D space. It solves the problem of handling 3D rotations more efficiently and intuitively than using Euler angles or rotation matrices, avoiding issues like gimbal lock. The library provides tools for creating quaternions, rotating vectors, interpolating between orientations, and converting between different rotation representations.
Developers and researchers working in 3D animation, computer graphics, robotics, game development, or scientific computing who need to perform 3D rotations in Python. It's particularly useful for those implementing smooth animations, kinematic simulations, or geometric transformations.
Developers choose pyquaternion because it offers a fully-featured, pythonic API that simplifies complex quaternion operations, making 3D rotation tasks more accessible. Its focus on interpolation and smooth animation, combined with robust conversion utilities, provides a practical alternative to lower-level math libraries.
A fully featured, pythonic library for representing and using quaternions
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Includes spherical linear interpolation (SLERP) for smooth animations and conversion utilities between quaternions, matrices, and Euler angles, as demonstrated in the demo for intermediate rotations.
Features an intuitive interface with methods like `Quaternion.rotate()` and constructors from axis-angle, making it feel native to Python developers and reducing boilerplate code.
Designed for Python 2.7+ and 3.0+, it seamlessly works with Python data structures and can be installed via pip, ensuring quick adoption in diverse projects.
Prioritizes readability and practicality over mathematical purity, offering robust functionality for common 3D rotation tasks without excessive complexity.
As a pure Python library, it may not match the speed of C-based alternatives like Eigen or specialized GPU libraries for large-scale data processing or real-time applications.
Lacks support for dual quaternions or other specialized quaternion types, which are essential for advanced computer graphics techniques like skeletal animation or certain robotics applications.
Adds a standalone dependency that might be redundant if projects already use comprehensive math libraries like SciPy, which offer some quaternion functionality integrated with broader numerical tools.