Search in sources :

Example 1 with UnitSphereRandomVectorGenerator

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);
    }
}
Also used : Vector3D(org.hipparchus.geometry.euclidean.threed.Vector3D) UnitSphereRandomVectorGenerator(org.hipparchus.random.UnitSphereRandomVectorGenerator) S2Point(org.hipparchus.geometry.spherical.twod.S2Point) GeodeticPoint(org.orekit.bodies.GeodeticPoint) Well1024a(org.hipparchus.random.Well1024a) Test(org.junit.Test)

Aggregations

Vector3D (org.hipparchus.geometry.euclidean.threed.Vector3D)1 S2Point (org.hipparchus.geometry.spherical.twod.S2Point)1 UnitSphereRandomVectorGenerator (org.hipparchus.random.UnitSphereRandomVectorGenerator)1 Well1024a (org.hipparchus.random.Well1024a)1 Test (org.junit.Test)1 GeodeticPoint (org.orekit.bodies.GeodeticPoint)1