Calculate quaternion with rotation matrix.
Project description
rotmat_to_quaternion
Calculate quaternion with rotation matrix.
Installation
pip install rotmat_to_quaternion
Usage
from rotmat_to_quaternion import quaternion_to_rotation_matrix
from rotmat_to_quaternion import rotation_matrix_to_quaternion
import math
# Test quaternion: 90° rotation around Z-axis
q = [math.sqrt(2)/2, 0.0, 0.0, math.sqrt(2)/2]
print("Original quaternion [w,x,y,z]:")
print([round(v, 6) for v in q])
# Convert to rotation matrix
mat = quaternion_to_rotation_matrix(q)
print("\nQuaternion -> Rotation Matrix:")
for row in mat:
print([round(v, 6) for v in row])
# Convert back to quaternion
q_recovered = rotation_matrix_to_quaternion(mat)
print("\nRotation Matrix -> Quaternion [w,x,y,z]:")
print([round(v, 6) for v in q_recovered])
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
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 rotmat_to_quaternion-0.1.0.tar.gz.
File metadata
- Download URL: rotmat_to_quaternion-0.1.0.tar.gz
- Upload date:
- Size: 2.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.3.2 CPython/3.13.12 Windows/11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a85853c907608e5e81251acd357058e108b8a8628dd4800f039df829fc397e50
|
|
| MD5 |
493dc5615d1f5b937415bb2a0fea3897
|
|
| BLAKE2b-256 |
8119dfd096ebcdb185d6df34b5931881df7df01f9e5f7ad4fd83113cdddf0904
|
File details
Details for the file rotmat_to_quaternion-0.1.0-py3-none-any.whl.
File metadata
- Download URL: rotmat_to_quaternion-0.1.0-py3-none-any.whl
- Upload date:
- Size: 3.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.3.2 CPython/3.13.12 Windows/11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ee06de0759de722caa1044ab9c9d4d3c2fbf80c7a4212621f660ca691e412369
|
|
| MD5 |
424b9a35b5023262e165b2e40e9be9fa
|
|
| BLAKE2b-256 |
e3886d7aef4cc82c5b7ffe4101fc9441b3bbd5862d233b9d3f7322417f643004
|