mirror of
https://github.com/PoetryInCode/simple-rigid-sim.git
synced 2025-06-10 03:13:10 -04:00
vector initialization
This commit is contained in:
parent
8c0714c8c6
commit
8d4b95c3fc
@ -6,7 +6,10 @@ Vector::Vector(float x, float y) {
|
|||||||
this->y=y;
|
this->y=y;
|
||||||
}
|
}
|
||||||
|
|
||||||
Vector::Vector() {}
|
Vector::Vector() {
|
||||||
|
this->x=0;
|
||||||
|
this->y=0;
|
||||||
|
}
|
||||||
|
|
||||||
int Vector::distanceTo(Vector vec) {
|
int Vector::distanceTo(Vector vec) {
|
||||||
return sqrt(pow(abs(x - vec.x),2)+pow(abs(y - vec.y),2));
|
return sqrt(pow(abs(x - vec.x),2)+pow(abs(y - vec.y),2));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user