欧拉角、旋转矩阵、四元数、角轴及外参变换基础库,支持多种旋转顺序
Project description
transform-base
欧拉角、旋转矩阵、四元数、角轴及外参变换基础库,支持多种旋转顺序(XYZ/XZY/YXZ/YZX/ZXY/ZYX)。
安装
pip install transform-base
功能特性
- 角度归一化:
normalize_angle将角度归一化到 [-180, 180] - 欧拉角 ↔ 旋转矩阵:支持 6 种旋转顺序(order),默认 ZYX
- 旋转矩阵 ↔ 四元数:
[x, y, z, w]格式 - 旋转矩阵 ↔ 角轴:Rodrigues 公式
- 外参类 ExtrinsicParam:欧拉/旋转矩阵/四元数/角轴多种初始化,齐次矩阵、点变换、复合与逆
快速开始
from transform_base import (
normalize_angle,
standard_euler_to_rotation_matrix,
rotation_matrix_to_standard_euler,
ExtrinsicParam,
)
# 欧拉角 -> 旋转矩阵 -> 欧拉角
euler = [10.0, 20.0, 30.0] # roll, pitch, yaw (度)
R = standard_euler_to_rotation_matrix(*euler, order="ZYX")
euler_back = rotation_matrix_to_standard_euler(R, order="ZYX")
# 外参:欧拉角 + 平移
ext = ExtrinsicParam(euler=[0, 0, 90], translation=[1, 0, 0])
p_out = ext.transform_point([1, 0, 0])
ext_inv = ext.inverse()
依赖
- Python >= 3.10
- numpy >= 1.20
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
transform_base-0.0.2.tar.gz
(7.9 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file transform_base-0.0.2.tar.gz.
File metadata
- Download URL: transform_base-0.0.2.tar.gz
- Upload date:
- Size: 7.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.19
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e17c60666c1245d1eb4df28e6f2bed1b4b6c83e221dffaf0751ee760cc24dd73
|
|
| MD5 |
d969e346bab810e709377646316bc1a0
|
|
| BLAKE2b-256 |
cf294571a4656c9b1e1806b8976425f9ea3c1efa3dd4c53e0af9e66e533fba59
|
File details
Details for the file transform_base-0.0.2-py3-none-any.whl.
File metadata
- Download URL: transform_base-0.0.2-py3-none-any.whl
- Upload date:
- Size: 7.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.19
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4649e0ae657d9d046dde02f3bbb9880bff38008478182795250d475fc84323a0
|
|
| MD5 |
dec40a7e0ed1b29f3705177d1ed567d7
|
|
| BLAKE2b-256 |
980245633fd415fc860a5a32b02b82baa1b6e495b7a648c9f401ca39a3553e69
|