# shz_quat_rotate_towards

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

> Rotates quaternion from towards quaternion to by at most max_angle radians

```c
SHZ_INLINE shz_quat_t shz_quat_rotate_towards(shz_quat_t from, shz_quat_t to, float max_angle) SHZ_NOEXCEPT;
```

Rotates quaternion `from` towards quaternion `to` by at most `max_angle` radians.

## Parameters

| Name | Type | Description |
| --- | --- | --- |
| `from` | `shz_quat_t` |  |
| `to` | `shz_quat_t` |  |
| `max_angle` | `float` |  |

## Returns

`shz_quat_t`

## Notes

- Returns `to` if the angle between them is already less than `max_angle`.

## Availability

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