// checks whether this vector is parallel to the parameter vector public Boolean IsParallelTo(Vector2D Vec) { Vector2D Vec1 = UnitVector(); Vector2D Vec2 = Vec.UnitVector(); if ((Vec1.X == Vec2.X && Vec1.Y == Vec2.Y) || (Vec1.X == -Vec2.X && Vec1.Y == -Vec2.Y)) { return true; } else { return false; } }
// checks whether this vector is codirectional to the parameter vector public Boolean IsCodirectionalTo(Vector2D Vec) { Vector2D Vec1 = UnitVector(); Vector2D Vec2 = Vec.UnitVector(); if (Vec1.X == Vec2.X && Vec1.Y == Vec2.Y) { return true; } else { return false; } }