# shz_vec3_rotate_zxy

Source: https://sh4zam.com/api/vector/shz_vec3_rotate_zxy/

```c
SHZ_INLINE shz_vec3_t shz_vec3_rotate_zxy(shz_vec3_t vec, float zRadians, float xRadians, float yRadians) SHZ_NOEXCEPT;
```

Rotates the given 3D vector by a Z-X-Y rotation, with the corresponding angles given in radians.

## Parameters

| Name | Type | Description |
| --- | --- | --- |
| `vec` | `shz_vec3_t` | The vector to rotate. |
| `zRadians` | `float` | Angle about the Z axis, in radians. |
| `xRadians` | `float` | Angle about the X axis, in radians. |
| `yRadians` | `float` | Angle about the Y axis, in radians. |

## Returns

`vec` rotated by the given angles.

## Details

The result is equivalent to transforming `vec` by the matrix built by `shz_xmtrx_init_rotation_zxy()`.

## Notes

- The given angles are represented as Tait-Bryan angles, representing an intrinsic rotation.

## Warnings

- This routine should only be used for one-off rotations of a single vector. To rotate multiple vectors in a batch, use the XMTRX API.

## Availability

- **C++ equivalent:** none (call the C function from C++)
- **Type-generic form:** none
- **Back-ends:** SH4: shared C implementation · SW: portable C · SPU: shared C implementation
- **Defined in:** [`sh4zam/shz_vector.h:1086`](https://github.com/gyrovorbis/sh4zam/blob/6b22b851ad9ca109049f956dbbbecf7c519c959f/include/sh4zam/shz_vector.h#L1086)
- **Module:** [Vector](https://sh4zam.com/api/vector/), section "Rotations"

## See also

[`shz_xmtrx_init_rotation_zxy`](https://sh4zam.com/api/xmtrx/shz_xmtrx_init_rotation_zxy/), [`shz_vec3_rotate_x`](https://sh4zam.com/api/vector/shz_vec3_rotate_x/), [`shz_vec3_rotate_y`](https://sh4zam.com/api/vector/shz_vec3_rotate_y/), [`shz_vec3_rotate_z`](https://sh4zam.com/api/vector/shz_vec3_rotate_z/)
