# shz_quat_squad

Source: https://sh4zam.com/api/quat/shz_quat_squad/

> Evaluates a smooth cubic spherical interpolation (SQUAD) at parameter t

```c
SHZ_INLINE shz_quat_t shz_quat_squad(shz_quat_t q1, shz_quat_t q2, shz_quat_t s1, shz_quat_t s2, float t) SHZ_NOEXCEPT;
```

Evaluates a smooth cubic spherical interpolation (SQUAD) at parameter `t`.

## Parameters

| Name | Type | Description |
| --- | --- | --- |
| `q1` | `shz_quat_t` | Start quaternion. |
| `q2` | `shz_quat_t` | End quaternion. |
| `s1` | `shz_quat_t` | Inner control point for `q1` (typically computed from surrounding keyframes). |
| `s2` | `shz_quat_t` | Inner control point for `q2` (typically computed from surrounding keyframes). |
| `t` | `float` | Interpolation factor in \[0, 1\]. |

## Returns

Resulting interpolated quaternion

## Notes

- SQUAD(q1, q2, s1, s2, t) = slerp(slerp(q1, q2, t), slerp(s1, s2, t), 2t(1-t))

## Availability

- **C++ equivalent:** [`shz::quat::squad`](https://sh4zam.com/api/cpp/quat/#squad)
- **Type-generic form:** none
- **Back-ends:** SH4: shared C implementation · SW: portable C · SPU: shared C implementation
- **Defined in:** [`sh4zam/shz_quat.h:143`](https://github.com/gyrovorbis/sh4zam/blob/ba1e30c88d49df0311870b229e1dd860ef26c477/include/sh4zam/shz_quat.h#L143)
- **Module:** [Quaternion](https://sh4zam.com/api/quat/), section "Initialization"
