# shz_vec2_t

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

```c
typedef struct shz_vec2 {
    union {
        float e[2];  //!< <X, Y> coordinates as an array
        struct {
            float x; //!< X coordinate
            float y; //!< Y coordinate
        };
    };
} shz_vec2_t;
```

2D Vector type

## Fields

| Field | Type | Description |
| --- | --- | --- |
| `e` | `float[2]` | \<X, Y> coordinates as an array |
| `x` | `float` | X coordinate. |
| `y` | `float` | Y coordinate. |

## Details

Structure for holding coordinates of a 2-dimensional vector.

## Availability

- **C++ equivalent:** [`shz::vec2`](https://sh4zam.com/api/cpp/vec2/)
- **Back-ends:** n/a (not a function)
- **Defined in:** [`sh4zam/shz_vector.h:38`](https://github.com/gyrovorbis/sh4zam/blob/ba1e30c88d49df0311870b229e1dd860ef26c477/include/sh4zam/shz_vector.h#L38)
- **Module:** [Vector](https://sh4zam.com/api/vector/), section "Types"

## See also

[`shz_vec3_t`](https://sh4zam.com/api/vector/shz_vec3_t/), [`shz_vec4_t`](https://sh4zam.com/api/vector/shz_vec4_t/)
