> ## 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.

# Beta.scene.rotation

Public rotation types and convenience constructors.

## QuaternionRotation Objects

```python theme={"dark"}
@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

```python theme={"dark"}
@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

```python theme={"dark"}
@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

```python theme={"dark"}
def identity_rotation() -> QuaternionRotation
```

Return the identity rotation (no rotation).

#### rotation\_x

```python theme={"dark"}
def rotation_x(angle: float) -> EulerRotation
```

Rotation around the *x*-axis only.

**Arguments**:

* `angle` - Rotation angle in radians.

#### rotation\_y

```python theme={"dark"}
def rotation_y(angle: float) -> EulerRotation
```

Rotation around the *y*-axis only.

**Arguments**:

* `angle` - Rotation angle in radians.

#### rotation\_z

```python theme={"dark"}
def rotation_z(angle: float) -> EulerRotation
```

Rotation around the *z*-axis only.

**Arguments**:

* `angle` - Rotation angle in radians.
