libGumball 0.0.2
C23-Based, libGimbal-powered UI Library
Loading...
Searching...
No Matches
gumball_vector2.h File Reference

Go to the source code of this file.

Data Structures

struct  GUM_Vector2

Macros

#define GUM_VECTOR2_TYPE

Functions

GBL_EXPORT GUM_Vector2 GUM_Vector2_add (GUM_Vector2 a, GUM_Vector2 b) GBL_NOEXCEPT
GBL_EXPORT GUM_Vector2 GUM_Vector2_subtract (GUM_Vector2 a, GUM_Vector2 b) GBL_NOEXCEPT
GBL_EXPORT GUM_Vector2 GUM_Vector2_scale (GUM_Vector2 a, float scalar) GBL_NOEXCEPT
GBL_EXPORT float GUM_Vector2_distance (GUM_Vector2 a, GUM_Vector2 b) GBL_NOEXCEPT
GBL_EXPORT float GUM_Vector2_length (GUM_Vector2 a) GBL_NOEXCEPT
GBL_EXPORT float GUM_Vector2_angle (GUM_Vector2 a, GUM_Vector2 b) GBL_NOEXCEPT
GBL_EXPORT float GUM_Vector2_angleTo (GUM_Vector2 from, GUM_Vector2 to, GUM_Vector2 dir) GBL_NOEXCEPT
GBL_EXPORT float GUM_Vector2_signedAngleTo (GUM_Vector2 from, GUM_Vector2 to, GUM_Vector2 dir) GBL_NOEXCEPT
GBL_EXPORT float GUM_Vector2_dot (GUM_Vector2 a, GUM_Vector2 b) GBL_NOEXCEPT
GBL_EXPORT float GUM_Vector2_cross (GUM_Vector2 a, GUM_Vector2 b) GBL_NOEXCEPT

Detailed Description

GUM_Vector2 is a simple 2D vector structure.

Author
2025 Agustín Bellagamba

Macro Definition Documentation

◆ GUM_VECTOR2_TYPE

#define GUM_VECTOR2_TYPE

Returns the GUM_Vector2 Type UUID.

Function Documentation

◆ GUM_Vector2_add()

GBL_EXPORT GUM_Vector2 GUM_Vector2_add ( GUM_Vector2 a,
GUM_Vector2 b )

Returns the sum of two vectors.

◆ GUM_Vector2_subtract()

GBL_EXPORT GUM_Vector2 GUM_Vector2_subtract ( GUM_Vector2 a,
GUM_Vector2 b )

Returns the difference of two vectors.

◆ GUM_Vector2_scale()

GBL_EXPORT GUM_Vector2 GUM_Vector2_scale ( GUM_Vector2 a,
float scalar )

Returns the product of a vector and a scalar.

◆ GUM_Vector2_distance()

GBL_EXPORT float GUM_Vector2_distance ( GUM_Vector2 a,
GUM_Vector2 b )

Returns the distance between two vectors.

◆ GUM_Vector2_length()

GBL_EXPORT float GUM_Vector2_length ( GUM_Vector2 a)

Returns the length of a vector.

◆ GUM_Vector2_angle()

GBL_EXPORT float GUM_Vector2_angle ( GUM_Vector2 a,
GUM_Vector2 b )

Returns the angle of (b - a).

Range (-pi, pi)

◆ GUM_Vector2_angleTo()

GBL_EXPORT float GUM_Vector2_angleTo ( GUM_Vector2 from,
GUM_Vector2 to,
GUM_Vector2 dir )

Returns the unsigned angle between dir and (to - from).

Range (0, pi)

◆ GUM_Vector2_signedAngleTo()

GBL_EXPORT float GUM_Vector2_signedAngleTo ( GUM_Vector2 from,
GUM_Vector2 to,
GUM_Vector2 dir )

Returns the signed angle from dir to (to - from).

Range (-pi, pi)

◆ GUM_Vector2_dot()

GBL_EXPORT float GUM_Vector2_dot ( GUM_Vector2 a,
GUM_Vector2 b )

Returns the dot product of two vectors.

◆ GUM_Vector2_cross()

GBL_EXPORT float GUM_Vector2_cross ( GUM_Vector2 a,
GUM_Vector2 b )

Returns the cross product of two vectors.