Skip to main content

A small tutorial.

Project description

Description

transrot is a lightweight Python package to calculate the translation vector and rotational matrix between two sets of 3D coordinates. This transformation can be applied to another set of coordinates

Installation

pip install transrot

How To?

from transrot import TransRot
import numpy as np

# Get your (n, 3) array of coordinates
coords1 = np.random.random((5, 3))
coords2 = np.random.random((5, 3))
coords3 = np.random.random((5, 3))

# Initialize the class
transformation = TransRot(
    coords1=coords1,
    coords2=coords2
)

# Calculate rotational matrix and translational vector that aligns coords1 to coords2
transformation.fit()

# Transform a set of coordinates with the calculated transformation
transformed_coords = transformation.transform(coords3)

Issues

If you have found a bug, please open an issue on the GitHub Issues.

Funding

This project received funding from Marie Skłodowska-Curie Actions. It was developed in the Computational Biophysics Group of Saarland University.

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

transrot-0.0.0.tar.gz (4.1 kB view hashes)

Uploaded Source

Built Distribution

transrot-0.0.0-py3-none-any.whl (4.1 kB view hashes)

Uploaded Python 3

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