@Test public void testDistanceILocated2D() { Tuple2D test = new Tuple2D(1, 1); ILocated2D otherTest = new Tuple2D(0, 0); assertEquals(test.distance(otherTest), Math.sqrt(2), ERROR); }
public double distance(ILocated2D other) { return distance(new Point2D.Double(other.getX(), other.getY())); }
Tuple2D extends Point2D.Double implements ILocated2D { public double distance(ILocated2D other) { return distance(new Point2D.Double(other.getX(), other.getY())); } }
Tuple2D extends Point2D.Double implements ILocated2D { public double distance(ILocated2D other) { return distance(new Point2D.Double(other.getX(), other.getY())); } Tuple2D(double x, double y); }
Tuple2D extends Point2D.Double implements ILocated2D { public double distance(ILocated2D other) { return distance(new Point2D.Double(other.getX(), other.getY())); } Tuple2D(double x, double y); boolean isZero(); double length(); Tuple2D normalize(); double angle(); Tuple2D midpoint(Tuple2D position); Tuple2D add(Tuple2D position); Tuple2D sub(ILocated2D rhs); Tuple2D mult(double i); Tuple2D div(double i); Tuple2D getPosition(); Tuple2D rotate(double radians); double distance(ILocated2D other); @Override String toString(); double angleBetweenTargets(ILocated2D a, ILocated2D b); }
Tuple2D extends Point2D.Double implements ILocated2D { public double distance(ILocated2D other) { return distance(new Point2D.Double(other.getX(), other.getY())); } Tuple2D(double x, double y); boolean isZero(); double length(); Tuple2D normalize(); double angle(); Tuple2D midpoint(Tuple2D position); Tuple2D add(Tuple2D position); Tuple2D sub(ILocated2D rhs); Tuple2D mult(double i); Tuple2D div(double i); Tuple2D getPosition(); Tuple2D rotate(double radians); double distance(ILocated2D other); @Override String toString(); double angleBetweenTargets(ILocated2D a, ILocated2D b);  }