S1Point implements Point<Sphere1D> { public double distance(final Point<Sphere1D> point) { return distance(this, (S1Point) point); } S1Point(final double alpha); private  S1Point(final double alpha, final Vector2D vector); double getAlpha(); Vector2D getVector(); Space getSpace(); boolean isNaN(); double distance(final Point<Sphere1D> point); static double distance(S1Point p1, S1Point p2); @Override boolean equals(Object other); @Override int hashCode(); static final S1Point NaN; }
@Test public void testDistance() { S1Point a = new S1Point(1.0); S1Point b = new S1Point(a.getAlpha() + 0.5 * FastMath.PI); Assert.assertEquals(0.5 * FastMath.PI, a.distance(b), 1.0e-10); }