skillfed

transformations

Homogeneous Transformation Matrices and Quaternions

transformations v2026.8.8 1.2M downloads/30d#4,163 on PyPI103
Permissive license BSD-3-Clause Active released

What it is and what it does

Transformations is a Python library for working with 3D homogeneous transformation matrices and quaternions. It provides functions to construct and manipulate 4x4 matrices for common 3D operations—translation, rotation, scaling, shearing, reflection, and projection—and to convert between different rotation representations (matrices, Euler angles, quaternions). The library also includes utilities like matrix decomposition and an Arcball control object for interactive 3D rotation.

The package depends only on numpy and includes a C extension for performance-critical operations. It is maintained but explicitly noted as no longer actively developed; the author recommends considering alternatives like Pytransform3d, scipy.spatial.transform, or transforms3d for new projects. The API is not stable and may change between releases.

Use it for:

  • Convert between Euler angles and rotation matrices in computer graphics or robotics pipelines.
  • Compose multiple 3D transformations (rotation, translation, scaling) into a single matrix.
  • Decompose a transformation matrix into its constituent scale, shear, rotation, and translation components.
  • Work with quaternions for smooth 3D rotations and interpolation in animation or game engines.
  • Implement Arcball-style interactive 3D rotation controls in visualization applications.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Calculates 4x4 homogeneous transformation matrices for 3D coordinate operations (translation, rotation, scaling, shearing) and converts between rotation matrices, Euler angles, and quaternions.

Yes, if you are working with legacy code or have a specific need for homogeneous transformation matrices and quaternion conversions. The package is stable, permissively licensed, and actively maintained. However, for new projects, consider the alternatives mentioned in the documentation (Pytransform3d, scipy.spatial.transform, transforms3d) which may offer more active development and fewer known numerical instabilities.

Install

transformations on PyPI

pip

pip install transformations

uv

uv add transformations

poetry

poetry add transformations

Installing transformations

Before you install

Medium install friction due to compiled C extensions, but wheels are widely available for modern Python versions (3.12+) and common platforms. Actively maintained with recent updates; last commit 2026-08-09.

License in practice

BSD-3-Clause is permissive; you can use, modify, and distribute this package with minimal restrictions, provided you include the license notice.

Quickstart

import numpy
from transformations import rotation_matrix, euler_from_matrix

R = rotation_matrix(0.5, [1, 0, 0])  # 0.5 rad rotation around x-axis
angles = euler_from_matrix(R, 'rxyz')

Requires numpy 2.5.2 (or compatible version); Python 3.12 or later.

Verify before relying

  • Whether the known numerical instabilities mentioned in the description affect your specific use case.
  • Performance characteristics compared to the suggested alternatives (Pytransform3d, scipy.spatial.transform, transforms3d).

Package facts

License BSD-3-Clause (permissive)
Python support supports the current Python release (>=3.12)
Install friction medium — platform-specific wheel
Runtime dependencies 1 — numpy
Maintenance actively maintained — 5 days since the last release
Last repo commit
First released
Downloads 1,247,443/month — #4,163 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: transformations-2026.8.8-cp312-abi3-macosx_10_13_x86_64.whl; transformations-2026.8.8-cp312-abi3-macosx_11_0_arm64.whl; transformations-2026.8.8-cp312-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl; transformations-2026.8.8-cp312-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl; transformations-2026.8.8-cp312-abi3-pyemscripten_2025_0_wasm32.whl; transformations-2026.8.8-cp312-abi3-pyemscripten_2026_0_wasm32.whl; transformations-2026.8.8-cp312-abi3-pyemscripten_2026_5_wasm32.whl; transformations-2026.8.8-cp312-abi3-win32.whl; transformations-2026.8.8-cp312-abi3-win_amd64.whl; transformations-2026.8.8-cp312-abi3-win_arm64.whl; transformations-2026.8.8-cp314-cp314t-macosx_10_15_x86_64.whl; transformations-2026.8.8-cp314-cp314t-macosx_11_0_arm64.whl; transformations-2026.8.8-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl; transformations-2026.8.8-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl; transformations-2026.8.8-cp314-cp314t-win32.whl; transformations-2026.8.8-cp314-cp314t-win_amd64.whl; transformations-2026.8.8-cp314-cp314t-win_arm64.whl; transformations-2026.8.8-cp315-cp315t-macosx_10_15_x86_64.whl; transformations-2026.8.8-cp315-cp315t-macosx_11_0_arm64.whl; transformations-2026.8.8-cp315-cp315t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl

Development Status :: 4 - BetaIntended Audience :: DevelopersIntended Audience :: Science/ResearchOperating System :: OS IndependentProgramming Language :: CProgramming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.15

Tags

3d transformation matricesquaternion rotation conversionhomogeneous coordinateseuler angles to matrix3d geometry transformationsrotation matrix operationsquaternion math library
3d-graphicsquaternionslinear-algebra

More Mathematics packages