# gizlang/animation

```gizlang
import * as Animation from "gizlang/animation";
```

## Types

### `Channel`

```gizlang
type Channel = { times: Vec<f64>; values: Vec<f64>; lanes: i64; interpolation: string; quaternion: bool; }
```

A sampled field channel. CUBICSPLINE values contain in-tangent, value and out-tangent for every key.

- `times`: `Vec<f64>`
- `values`: `Vec<f64>`
- `lanes`: `i64`
- `interpolation`: `string`
- `quaternion`: `bool`

## Functions

### `validate`

```gizlang
function validate(channel: Channel): void throws string
```

Validates a channel once, before it participates in simulation.

Effects: fail, alloc.

### `blend`

```gizlang
function blend(values: Vec<Vec<f64>>, weights: Vec<f64>, quaternion: bool = false): Vec<f64> throws string
```

Normalized weighted layers. Rotations use hemisphere-correct quaternion nlerp, shared by tools and runtime poses.

Effects: fail, read, write, alloc.

### `sample`

```gizlang
function sample(channel: Channel, time: f64): Vec<f64> throws string
```

Samples a validated channel, clamping before/after its keys. Quaternion LINEAR uses shortest-path slerp.

Effects: fail, read, write, alloc.

