#include "matematik.h" float distance(Vector2 a, Vector2 b){ return sqrt(pow(a.x - b.x, 2) + pow(a.y - b.y, 2)); } Vector2 normalize_vector(Vector2 vec){ float len = sqrt(vec.x * vec.x + vec.y * vec.y); vec.x /= len; vec.y /= len; return vec; } Vector2 vector_diff(Vector2 a, Vector2 b){ return (Vector2) { a.x - b.x, a.y - b.y }; }