Skip to main content

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 space
  • Quaternion: 3d rotation and orientation in cartesian space
  • Transformaton: 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


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.1.0.tar.gz (20.3 kB view details)

Uploaded Source

Built Distribution

asl_utility-1.1.0-py3-none-any.whl (25.8 kB view details)

Uploaded Python 3

File details

Details for the file asl_utility-1.1.0.tar.gz.

File metadata

  • Download URL: asl_utility-1.1.0.tar.gz
  • Upload date:
  • Size: 20.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.13

File hashes

Hashes for asl_utility-1.1.0.tar.gz
Algorithm Hash digest
SHA256 c7af4c0e9385bc8acda3dd5f1bb89a1d790053810d5c15a65ae064ec32517199
MD5 bc8453ff3474ba9a4b3f026c5575e45e
BLAKE2b-256 e54b7d6a48f59f84c49f38f562d0b7ae4fac79892f92aef52666108ccc5a17f2

See more details on using hashes here.

File details

Details for the file asl_utility-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: asl_utility-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 25.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.13

File hashes

Hashes for asl_utility-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bb07e2e90888c929b414f80cfef8fbe33cdabee51847f009cb41b12d3242707b
MD5 1d580b514a6d96897de16942d54ed46e
BLAKE2b-256 1b3a70ddf22a7c27638f8c2dd72d35e2517405bd5315681efe7abd17c935edfc

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page