use of org.hipparchus.random.UnitSphereRandomVectorGenerator in project Orekit by CS-SI.
the class FieldOfViewTest method testSquare.
@Test
public void testSquare() throws OrekitException {
FieldOfView square1 = new FieldOfView(Vector3D.PLUS_K, Vector3D.PLUS_I, 0.25, Vector3D.MINUS_J, 0.25, 0.0);
FieldOfView square2 = new FieldOfView(Vector3D.PLUS_K, Vector3D.PLUS_I, 0.25, 4, 0.0);
Assert.assertEquals(square1.getZone().getSize(), square2.getZone().getSize(), 1.0e-15);
Assert.assertEquals(square1.getZone().getBoundarySize(), square2.getZone().getBoundarySize(), 1.0e-15);
UnitSphereRandomVectorGenerator random = new UnitSphereRandomVectorGenerator(3, new Well1024a(0x17df21c7598b114bl));
for (int i = 0; i < 1000; ++i) {
Vector3D v = new Vector3D(random.nextVector()).scalarMultiply(1.0e6);
Assert.assertEquals(square1.offsetFromBoundary(v), square2.offsetFromBoundary(v), 1.0e-15);
}
}
Aggregations