# shz_vec2_magnitude_inv_fsrra

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

```c
SHZ_INLINE float shz_vec2_magnitude_inv_fsrra(shz_vec2_t vec) SHZ_NOEXCEPT;
```

Returns the inverse magnitude of the given 2D vector, unsafely, using FSRRA.

## Parameters

| Name | Type | Description |
| --- | --- | --- |
| `vec` | `shz_vec2_t` | The vector whose inverse magnitude is returned. |

## Returns

`1.0f` divided by the magnitude of `vec`.

## Details

Faster alternative to `shz_vec2_magnitude_inv()` which does not check for a zero-length vector.

## Warnings

- Results in a division-by-zero when `vec` has a magnitude of `0.0f`.

## Naming and requirements

- `_fsrra`: Uses `FSRRA` (fast approximate 1/sqrt(x)). The argument or denominator must be positive. Faster, less precise. ([Naming and Suffixes](https://sh4zam.com/concepts/naming-and-suffixes/))

## Availability

- **C++ equivalent:** [`shz::vec2::magnitude_inv_fsrra`](https://sh4zam.com/api/cpp/vec2/#magnitude_inv_fsrra)
- **Type-generic form:** [`shz_vec_magnitude_inv_fsrra()`](https://sh4zam.com/api/vector/shz_vec_magnitude_inv_fsrra/)
- **Back-ends:** SH4: shared C implementation · SW: portable C · SPU: shared C implementation
- **Defined in:** [`sh4zam/shz_vector.h:598`](https://github.com/gyrovorbis/sh4zam/blob/6b22b851ad9ca109049f956dbbbecf7c519c959f/include/sh4zam/shz_vector.h#L598)
- **Module:** [Vector](https://sh4zam.com/api/vector/), section "Magnitude"

## See also

[`shz_vec2_magnitude_inv`](https://sh4zam.com/api/vector/shz_vec2_magnitude_inv/)
