#include "types.h" vec2 dp_vec2_new(float x, float y) { vec2 new; new.x = x; new.y = y; return new; } vec2 dp_vec2_add(vec2 a, vec2 b) { vec2 new; new.x = a.x + b.x; new.y = a.y + b.y; return new; } vec2 dp_vec2_sub(vec2 a, vec2 b) { vec2 new; new.x = a.x - b.x; new.y = a.y - b.y; return new; } vec2 dp_vec2_mul(vec2 vec, float scalar) { vec2 new; new.x = vec.x * scalar; new.y = vec.y * scalar; return new; } vec2 dp_vec2_dot(vec2 a, vec2 b) { vec2 dot; dot.x = a.x * b.x; dot.y = a.y * b.y; return dot; }