# shz_quat_transform_vec3

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

```c
SHZ_INLINE shz_vec3_t shz_quat_transform_vec3(shz_quat_t q, shz_vec3_t v) SHZ_NOEXCEPT;
```

Rotates a vector by the given quaternion.

## Parameters

| Name | Type | Description |
| --- | --- | --- |
| `q` | `shz_quat_t` |  |
| `v` | `shz_vec3_t` |  |

## Returns

`shz_vec3_t`

## Notes

- This routine is meant for one-off rotations of a single vector by a single quaternion. If you plan to rotate multiple vectors by the same quaternion, you should use the XMTRX API to apply the quaternion as a rotation matrix.

## Availability

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

## See also

[`shz_xmtrx_apply_rotation_quat`](https://sh4zam.com/api/xmtrx/shz_xmtrx_apply_rotation_quat/)
