@Test public void testSubtract() { Vector2 v0 = new Vector2(1.0, 1.0); Vector2 v1 = new Vector2(0.5, 0.5); Vector2 answer = v0.subtract(v1); assertEquals(answer.getX(), 0.5, delta); assertEquals(answer.getY(), 0.5, delta); }
public Vector2 subtract(Vector2 nodePosition) { return new Vector2(this.getX() - nodePosition.getX(), this.getY() - nodePosition.getY()); }
Vector2 implements IsSerializable { public Vector2 subtract(Vector2 nodePosition) { return new Vector2(this.getX() - nodePosition.getX(), this.getY() - nodePosition.getY()); } }
Vector2 implements IsSerializable { public Vector2 subtract(Vector2 nodePosition) { return new Vector2(this.getX() - nodePosition.getX(), this.getY() - nodePosition.getY()); } Vector2();  Vector2(double x, double y); }
Vector2 implements IsSerializable { public Vector2 subtract(Vector2 nodePosition) { return new Vector2(this.getX() - nodePosition.getX(), this.getY() - nodePosition.getY()); } 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 Vector2 subtract(Vector2 nodePosition) { return new Vector2(this.getX() - nodePosition.getX(), this.getY() - nodePosition.getY()); } 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);  }