@Test public void testDistance() { Vector2 v0 = new Vector2(0.0, 0.0); Vector2 v1 = new Vector2(1.0, 1.0); assertEquals(Math.sqrt(2.0), v0.distance(v1), delta); assertEquals(Math.sqrt(2.0), v1.distance(v0), delta); Vector2 v2 = new Vector2(2.0, 3.0); assertEquals(Math.sqrt(5.0), v1.distance(v2), delta); assertEquals(Math.sqrt(5.0), v2.distance(v1), delta); }
public double distance(Vector2 other) { return Math.sqrt(this.distanceSquared(other)); }
Vector2 implements IsSerializable { public double distance(Vector2 other) { return Math.sqrt(this.distanceSquared(other)); } }
Vector2 implements IsSerializable { public double distance(Vector2 other) { return Math.sqrt(this.distanceSquared(other)); } Vector2();  Vector2(double x, double y); }
Vector2 implements IsSerializable { public double distance(Vector2 other) { return Math.sqrt(this.distanceSquared(other)); } Vector2();  Vector2(double x, double y); Vector2 clone(); double getX(); void setX(double x); double getY(); void setY(double y); Vector2 add(Vector2 rhs); Vector2 subtract(Vector2 nodePosition); double length(); Vector2 rotate(double angle); double distance(Vector2 other); double distanceSquared(Vector2 other); String toString(); String toJSON(); void normalize(); double dot(Vector2 v); }
Vector2 implements IsSerializable { public double distance(Vector2 other) { return Math.sqrt(this.distanceSquared(other)); } Vector2();  Vector2(double x, double y); Vector2 clone(); double getX(); void setX(double x); double getY(); void setY(double y); Vector2 add(Vector2 rhs); Vector2 subtract(Vector2 nodePosition); double length(); Vector2 rotate(double angle); double distance(Vector2 other); double distanceSquared(Vector2 other); String toString(); String toJSON(); void normalize(); double dot(Vector2 v);  }