@Test public void testAngle() { Vector a = new Vector(0, 10); Vector b = new Vector(10, 0); Vector c = new Vector(0, -10); Vector d = new Vector(10, 10); Assert.assertEquals(0, a.angle(a), 0.000000001); Assert.assertEquals(90, a.angle(b), 0.0000001); Assert.assertEquals(180, a.angle(c), 0.00000001); Assert.assertEquals(45, a.angle(d), 0.00000001); }
public double angle(Vector other) { return Math.acos(scalar(other) / (magnitude() * other.magnitude())) / Math.PI * 180; }
Vector implements Serializable { public double angle(Vector other) { return Math.acos(scalar(other) / (magnitude() * other.magnitude())) / Math.PI * 180; } }
Vector implements Serializable { public double angle(Vector other) { return Math.acos(scalar(other) / (magnitude() * other.magnitude())) / Math.PI * 180; } Vector(double x, double y);  Vector(); }
Vector implements Serializable { public double angle(Vector other) { return Math.acos(scalar(other) / (magnitude() * other.magnitude())) / Math.PI * 180; } Vector(double x, double y);  Vector(); static Vector fromVertexPosition(EPGMVertex v); void setVertexPosition(EPGMVertex v); Vector sub(Vector other); Vector add(Vector other); Vector mul(double factor); Vector div(double factor); double distance(Vector other); double scalar(Vector other); Vector clamped(double maxLen); Vector normalized(); double magnitude(); Vector confined(double minX, double maxX, double minY, double maxY); double angle(Vector other); Vector rotate(double angle); @Override boolean equals(Object other); @Override int hashCode(); @Override String toString(); double getX(); void setX(double x); double getY(); void setY(double y); Vector set(double x, double y); Vector set(Vector other); Vector reset(); Vector copy(); Vector mSub(Vector other); Vector mAdd(Vector other); Vector mMul(double factor); Vector mDiv(double factor); Vector mClamped(double maxLen); Vector mNormalized(); Vector mConfined(double minX, double maxX, double minY, double maxY); Vector mRotate(double angle); }
Vector implements Serializable { public double angle(Vector other) { return Math.acos(scalar(other) / (magnitude() * other.magnitude())) / Math.PI * 180; } Vector(double x, double y);  Vector(); static Vector fromVertexPosition(EPGMVertex v); void setVertexPosition(EPGMVertex v); Vector sub(Vector other); Vector add(Vector other); Vector mul(double factor); Vector div(double factor); double distance(Vector other); double scalar(Vector other); Vector clamped(double maxLen); Vector normalized(); double magnitude(); Vector confined(double minX, double maxX, double minY, double maxY); double angle(Vector other); Vector rotate(double angle); @Override boolean equals(Object other); @Override int hashCode(); @Override String toString(); double getX(); void setX(double x); double getY(); void setY(double y); Vector set(double x, double y); Vector set(Vector other); Vector reset(); Vector copy(); Vector mSub(Vector other); Vector mAdd(Vector other); Vector mMul(double factor); Vector mDiv(double factor); Vector mClamped(double maxLen); Vector mNormalized(); Vector mConfined(double minX, double maxX, double minY, double maxY); Vector mRotate(double angle);  }