Utility components for numpy, math and transformations.
Project description
ASL Utility
This is a utility library mostly concerned with Numpy and spactial transformation helpers.
The main component is the asl_utility.transform
package. This contains multiple classes concerned with rotation,
transformation & translation.
Vector3
: 3d translation, offset or position in cartesian spaceQuaternion
: 3d rotation and orientation in cartesian spaceTransformaton
: 3d transformation (translate, rotate & scale) in cartesian space.
Furthermore, it has some interface and data holder classes to support these main components. Check the module and class documnentation for more details.
Installation
This library is available on PyPi.
pip install asl-utility
Example usage
import numpy as np
from asl_utility import transform_helpers
rot1 = transform_helpers.Quaternion.from_axis_and_angle((1, 0, 0), np.pi/4) # 45° around x-axis
rot2 = transform_helpers.Quaternion.from_euler("XYZ", [0, 0, 30], degrees=True)
rotation = rot1 * rot2
translation = transform_helpers.Vector3([42, 13, 37])
camera_to_world = transform_helpers.Transformation.from_translation_and_rotation(translation, rotation)
world_to_camera = camera_to_world.invert()
pos_in_cam = np.asarray([10, 20, 30])
pos_in_world = camera_to_world.apply_vector(pos_in_cam)
pos_in_cam2 = world_to_camera.apply_vector(pos_in_world)
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
asl_utility-1.0.0.tar.gz
(20.0 kB
view hashes)
Built Distribution
Close
Hashes for asl_utility-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ba522302bab78302b9133a373948b383126e157931f271f350430b1b3f9b8fcd |
|
MD5 | cf451091aa6568972c03b528e7392990 |
|
BLAKE2b-256 | 91f979073011442a1d97bfd5d13c19b30063be9efaaf5985a9a79f4cf324e9c7 |