libGumball 0.0.1
C23-Based, libGimbal-powered UI Library
Loading...
Searching...
No Matches
gumball_vector2.h
Go to the documentation of this file.
1#ifndef GUM_VECTOR2_H
2#define GUM_VECTOR2_H
3
4// View this file's documentation online: https://libgumball.psyops.studio/gumball__vector2_8h.html
5
6/*! \file
7 * \ingroup types
8 *
9 * GUM_Vector2 is a simple 2D vector structure
10 *
11 * \author 2025 Agustín Bellagamba
12 * \copyright MIT License
13*/
14
15#include <gimbal/gimbal_meta.h>
16
17GBL_DECLS_BEGIN
18
19/*! \struct GUM_Vector2
20 * \brief GUM_Vector2 structure
21*/
22typedef struct {
23 float x;
24 float y;
25} GUM_Vector2;
26
27#define GUM_VECTOR2_TYPE (GBL_TYPEID(GUM_Vector2)) //!< Returns the GUM_Vector2 Type UUID
28
29//! \cond
30GblType GUM_Vector2_type(void);
31//! \endcond
32
33GBL_EXPORT GUM_Vector2 GUM_Vector2_add (GUM_Vector2 a, GUM_Vector2 b) GBL_NOEXCEPT; //!< Returns the sum of two vectors
34GBL_EXPORT GUM_Vector2 GUM_Vector2_subtract (GUM_Vector2 a, GUM_Vector2 b) GBL_NOEXCEPT; //!< Returns the difference of two vectors
35GBL_EXPORT GUM_Vector2 GUM_Vector2_scale (GUM_Vector2 a, float scalar ) GBL_NOEXCEPT; //!< Returns the product of a vector and a scalar
36GBL_EXPORT float GUM_Vector2_distance (GUM_Vector2 a, GUM_Vector2 b) GBL_NOEXCEPT; //!< Returns the distance between two vectors
37GBL_EXPORT float GUM_Vector2_angle (GUM_Vector2 a, GUM_Vector2 b) GBL_NOEXCEPT; //!< Returns the angle between two vectors
38
39GBL_DECLS_END
40
41#endif // GUM_VECTOR2_H