First Commit

This commit is contained in:
2022-10-30 23:44:30 +01:00
commit fdd1e361c0
11 changed files with 251 additions and 0 deletions

27
Vector.cpp Normal file
View File

@ -0,0 +1,27 @@
#include "Vector.h"
#include <math.h>
Vec2 Vec2::operator+(const Vec2 right){
return {x + right.x, y + right.y};
}
Vec2 Vec2::operator*(const Vec2 right){
return {x * right.x, y * right.y};
}
Vec2 Vec2::operator*(const int right){
return {x * right, y * right};
}
Vec2 Vec2::operator/(const int right){
return {x / right, y / right};
}
int Vec2::norm(){
return sqrt(pow(x, 2) + pow(y,2));
}