Documentation Index
Fetch the complete documentation index at: https://docs.encord.com/llms.txt
Use this file to discover all available pages before exploring further.
Public rotation types and convenience constructors.
QuaternionRotation Objects
@dataclass
class QuaternionRotation()
Unit-quaternion rotation.
Each component must be in [-1.0, 1.0] and the quaternion must
have unit magnitude (sqrt(qx**2 + qy**2 + qz**2 + qw**2) ≈ 1.0,
tolerance 1e-2). These constraints are enforced server-side.
EulerRotation Objects
@dataclass
class EulerRotation()
Euler-angle rotation (radians), applied as extrinsic X-Y-Z.
Each angle must be in [-2.1pi, 2.1pi] (roughly +/-378 degrees).
This constraint is enforced server-side.
MatrixRotation Objects
@dataclass
class MatrixRotation()
3x3 rotation matrix (9 floats, column-major).
The 9 values are stored column-by-column::
Given the matrix:
| r00 r01 r02 |
| r10 r11 r12 |
| r20 r21 r22 |
Flat order: [r00, r10, r20, r01, r11, r21, r02, r12, r22]
— col 0 — — col 1 — — col 2 —
The matrix must be a proper rotation matrix: each column must be a
unit vector, all column pairs must be orthogonal, and the determinant
must equal 1.0. These constraints are enforced server-side.
identity_rotation
def identity_rotation() -> QuaternionRotation
Return the identity rotation (no rotation).
rotation_x
def rotation_x(angle: float) -> EulerRotation
Rotation around the x-axis only.
Arguments:
angle - Rotation angle in radians.
rotation_y
def rotation_y(angle: float) -> EulerRotation
Rotation around the y-axis only.
Arguments:
angle - Rotation angle in radians.
rotation_z
def rotation_z(angle: float) -> EulerRotation
Rotation around the z-axis only.
Arguments:
angle - Rotation angle in radians.