3D rigid transform: position (3) + rotation (quaternion, 4).
Constructors
| Constructor |
Description |
Transform() |
Identity. |
Transform(position, rotation) |
Construct from a 3-vector position and xyzw quaternion. |
Transform.identity() |
Identity (factory form). |
Transform.from_translation(t) |
Translation only. |
Transform.from_rotation(q) |
Rotation only. |
Transform.from_axis_angle(axis, angle) |
Rotation-only transform from an axis and angle in radians. |
Properties
| Property |
Description |
position |
3D position [m]. |
rotation |
Quaternion in [x, y, z, w] order. Constructor and property assignment do not normalize arbitrary input. |
Methods
| Method |
Description |
transform_point(point) |
Rotate and translate a local-space point. |
transform_vector(vector) |
Rotate a direction vector without translation. |
rotation_matrix() |
Returns the 3x3 rotation matrix. |
__mul__(other) |
Compose with another Transform. |
inverse() |
Returns the inverse transform. |
Example
import numpy as np
import novaphy
t = novaphy.Transform(
np.array([0.0, 1.0, 0.0], dtype=np.float32),
np.array([0.0, 0.0, 0.0, 1.0], dtype=np.float32),
)
world_point = t.transform_point(np.array([0.5, 0.0, 0.0], dtype=np.float32))
See Also