ArrivingKinematicAlgorithm implements ArrivingMotionAlgorithm, Serializable, Cloneable { @Override public Vector2D<?, ?> calculate(Point2D<?, ?> position, double linearSpeed, double maxLinearSpeed, Point2D<?, ?> target) { final Vector2d v = new Vector2d( target.getX() - position.getX(), target.getY() - position.getY()); if (v.getLengthSquared() <= this.stopSquaredDistance) { return new Vector2d(); } v.setLength(maxLinearSpeed); return v; } ArrivingKinematicAlgorithm(double stopDistance); @Pure @Override ArrivingKinematicAlgorithm clone(); @Override Vector2D<?, ?> calculate(Point2D<?, ?> position, double linearSpeed, double maxLinearSpeed,
			Point2D<?, ?> target);  }
@Test public void calculate_far() { assertFpVectorEquals(3.42997, 2.05798, this.arriving.calculate(new Point2d(1, 2), 3, 4, new Point2d(6, 5))); }
@Test public void calculate_close() { assertFpVectorEquals(0, 0, this.arriving.calculate(new Point2d(6.1, 4.8), 3, 4, new Point2d(6, 5))); }