added vector2.c
This commit is contained in:
parent
5badf331fd
commit
edaddeb109
1 changed files with 8 additions and 0 deletions
8
src/math/vector2.c
Normal file
8
src/math/vector2.c
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
#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;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue