S1Point implements Point<Sphere1D> { public S1Point(final double alpha) { this(MathUtils.normalizeAngle(alpha, FastMath.PI), new Vector2D(FastMath.cos(alpha), FastMath.sin(alpha))); } 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 testS1Point() { for (int k = -2; k < 3; ++k) { S1Point p = new S1Point(1.0 + k * MathUtils.TWO_PI); Assert.assertEquals(FastMath.cos(1.0), p.getVector().getX(), 1.0e-10); Assert.assertEquals(FastMath.sin(1.0), p.getVector().getY(), 1.0e-10); Assert.assertFalse(p.isNaN()); } }