class Vector
{
float x;
float y;
Point point1;
Point point2;
Vector(Point point1, Point point2)
{
this.point1 = point1;
this.point2 = point2;
this.x = this.point2.getX() - this.point1.getX();
this.y = this.point2.getY() - this.point1.getY();
//in einheitsvektor umwandeln
float value = sqrt(pow(this.x, 2) + pow(this.y, 2));
this.x = this.x / value;
this.y = this.y / value;
}
Vector(float x, float y)
{
this.x = x;
this.y = y;
}
float getX()
{
return this.x;
}
float getY()
{
return this.y;
}
}