# shz_vec2_normalize

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

```c
SHZ_INLINE shz_vec2_t shz_vec2_normalize(shz_vec2_t vec) SHZ_NOEXCEPT;
```

Returns a normalized unit vector from the given 2D vector.

## Parameters

| Name | Type | Description |
| --- | --- | --- |
| `vec` | `shz_vec2_t` |  |

## Returns

`shz_vec2_t`

## Availability

- **C++ equivalent:** [`shz::vec2::direction`](https://sh4zam.com/api/cpp/vec2/#direction), [`shz::vec2::normalize`](https://sh4zam.com/api/cpp/vec2/#normalize), [`shz::vec2::normalized`](https://sh4zam.com/api/cpp/vec2/#normalized)
- **Type-generic form:** [`shz_vec_normalize()`](https://sh4zam.com/api/vector/shz_vec_normalize/)
- **Back-ends:** SH4: shared C implementation · SW: portable C · SPU: shared C implementation
- **Defined in:** [`sh4zam/shz_vector.h:432`](https://github.com/gyrovorbis/sh4zam/blob/ba1e30c88d49df0311870b229e1dd860ef26c477/include/sh4zam/shz_vector.h#L432)
- **Module:** [Vector](https://sh4zam.com/api/vector/), section "Magnitude"
