Subastra
|
#include <vec2.h>
Static Public Member Functions | |
static vec2 | vec2_add (vec2 a, vec2 b) |
{.x = a.x + b.x, .y = a.y + b.y} | |
static vec2 | vec2_sub (vec2 a, vec2 b) |
{.x = a.x - b.x, .y = a.y - b.y} | |
static vec2 | vec2_scale (vec2 a, float c) |
{.x = c * a.x, .y = c * a.y} | |
static vec2 | vec2_perpendicular (vec2 v) |
{.x = -y, .y = x} | |
static norm2 | vec2_normalize (vec2 v) |
Returns a vector of length 1. Returns the 0 vector for vectors of length VEC2_EPSILON and smaller. | |
static float | vec2_dot (vec2 a, vec2 b) |
Returns a scalar product of the two vectors. | |
Data Fields | |
float | x |
float | y |
Returns a vector of length 1. Returns the 0 vector for vectors of length VEC2_EPSILON and smaller.
float x |
float y |