}
}
@Test
public void testTransform() {
RandomGenerator random = new Well1024a(0x16992fc4294bf2f1l);
UnitSphereRandomVectorGenerator sphRandom = new UnitSphereRandomVectorGenerator(3, random);
for (int i = 0; i < 100; ++i) {
Rotation r = new Rotation(new Vector3D(sphRandom.nextVector()),
FastMath.PI * random.nextDouble());
Transform<Sphere2D, Sphere1D> t = Circle.getTransform(r);
S2Point p = new S2Point(new Vector3D(sphRandom.nextVector()));
S2Point tp = (S2Point) t.apply(p);
Assert.assertEquals(0.0, r.applyTo(p.getVector()).distance(tp.getVector()), 1.0e-10);
Circle c = new Circle(new Vector3D(sphRandom.nextVector()), 1.0e-10);
Circle tc = (Circle) t.apply(c);
Assert.assertEquals(0.0, r.applyTo(c.getPole()).distance(tc.getPole()), 1.0e-10);
Assert.assertEquals(0.0, r.applyTo(c.getXAxis()).distance(tc.getXAxis()), 1.0e-10);
Assert.assertEquals(0.0, r.applyTo(c.getYAxis()).distance(tc.getYAxis()), 1.0e-10);
Assert.assertEquals(c.getTolerance(), ((Circle) t.apply(c)).getTolerance(), 1.0e-10);
SubLimitAngle sub = new LimitAngle(new S1Point(MathUtils.TWO_PI * random.nextDouble()),
random.nextBoolean(), 1.0e-10).wholeHyperplane();
Vector3D psub = c.getPointAt(((LimitAngle) sub.getHyperplane()).getLocation().getAlpha());
SubLimitAngle tsub = (SubLimitAngle) t.apply(sub, c, tc);
Vector3D ptsub = tc.getPointAt(((LimitAngle) tsub.getHyperplane()).getLocation().getAlpha());
Assert.assertEquals(0.0, r.applyTo(psub).distance(ptsub), 1.0e-10);