pawengine/types.c

9 lines
174 B
C
Raw Normal View History

2025-02-09 18:48:25 +01:00
#include "types.h"
#include "math.h"
struct Vec2 vec2_normalize(struct Vec2 v) {
float abs = sqrt(v.x * v.x + v.y * v.y);
return (struct Vec2){v.x / abs, v.y / abs};
}