# shz_mat4x4_transform_vec2

Source: https://sh4zam.com/api/matrix/shz_mat4x4_transform_vec2/

```c
SHZ_INLINE shz_vec2_t shz_mat4x4_transform_vec2(const shz_mat4x4_t* m, shz_vec2_t v) SHZ_NOEXCEPT;
```

Transforms a 2D vector by a 4x4 matrix.

## Parameters

| Name | Type | Description |
| --- | --- | --- |
| `m` | `const shz_mat4x4_t *` |  |
| `v` | `shz_vec2_t` |  |

## Returns

`shz_vec2_t`

## Details

This is a routine specializing in one-off transforms of a **single** 2D vector by a **single** 4x4 matrix. It should be faster than going through XMTRX.

## Notes

- For batch transforming multiple 2D vectors against the same 4x4 matrix, preload the matrix into XMTRX, then use `shz_xmtrx_transform_vec2()`.

## Naming and requirements

- `shz_mat4x4_t` and `shz_mat2x2_t` arguments must be 8-byte aligned. Unaligned data goes through the `float[16]` parameters of the `_unaligned` routines.

## 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_matrix.h:665`](https://github.com/gyrovorbis/sh4zam/blob/ba1e30c88d49df0311870b229e1dd860ef26c477/include/sh4zam/shz_matrix.h#L665)
- **Module:** [Matrix](https://sh4zam.com/api/matrix/), section "Transforming"

## See also

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