Rotation

class tri3d.geometry.Rotation(quat)[source]

A Rotation defined by a quaternion (w, x, y, z).

__matmul__(other)[source]

Compose transformations together.

The rightmost operation is applied first.

Parameters:

other (Transformation)

Return type:

Transformation

apply(x)[source]

Apply transformation to given point or array of points.

The broadcasting rules between transformations and their inputs are as follows:

transform

input

output

brodcast

[]

[3]

[3]

single mapping

[]

[n,3]

[n,3]

broadcast transform

[n]

[3]

[n,3]

broadcst input

[n]

[n]

[n,3]

one-to-one mapping

Return type:

ndarray

inv()[source]

Return inverse transformation.

property single

Whether this is a single transformation or a batch.

as_quat()[source]

Return the quaternion representation.

classmethod from_matrix(mat)[source]

Create a rotation from 3x3 or 4x4 rotation matrices.

as_matrix()[source]

Return the rotation as a 4x4 rotation matrix.

Return type:

ndarray