archeus/src/math/vector2.c

8 lines
226 B
C
Raw Normal View History

2023-01-30 23:23:03 -07:00
#include "arc/math/vector2.h"
#include <math.h>
void ARC_Vector2_Normalize(ARC_Vector2 *vector){
float length = sqrtf((vector->x * vector->x) + (vector->y * vector->y));
vector->x /= length;
vector->y /= length;
}