Search in sources :

Example 26 with Well1024a

use of org.hipparchus.random.Well1024a in project Orekit by CS-SI.

the class AngularCoordinatesTest method testDerivativesStructures2.

@Test
public void testDerivativesStructures2() throws OrekitException {
    RandomGenerator random = new Well1024a(0x1633878dddac047dl);
    Rotation r = randomRotation(random);
    Vector3D o = randomVector(random, 1.0e-2);
    Vector3D oDot = randomVector(random, 1.0e-2);
    AngularCoordinates ac = new AngularCoordinates(r, o, oDot);
    AngularCoordinates rebuilt = new AngularCoordinates(ac.toDerivativeStructureRotation(2));
    Assert.assertEquals(0.0, Rotation.distance(ac.getRotation(), rebuilt.getRotation()), 1.0e-15);
    Assert.assertEquals(0.0, Vector3D.distance(ac.getRotationRate(), rebuilt.getRotationRate()), 1.0e-15);
    Assert.assertEquals(0.0, Vector3D.distance(ac.getRotationAcceleration(), rebuilt.getRotationAcceleration()), 1.0e-15);
}
Also used : Vector3D(org.hipparchus.geometry.euclidean.threed.Vector3D) Rotation(org.hipparchus.geometry.euclidean.threed.Rotation) RandomGenerator(org.hipparchus.random.RandomGenerator) Well1024a(org.hipparchus.random.Well1024a) Test(org.junit.Test)

Example 27 with Well1024a

use of org.hipparchus.random.Well1024a in project Orekit by CS-SI.

the class AngularCoordinatesTest method testReverseOffset.

@Test
public void testReverseOffset() {
    RandomGenerator random = new Well1024a(0x4ecca9d57a8f1611l);
    for (int i = 0; i < 100; ++i) {
        Rotation r = randomRotation(random);
        Vector3D o = randomVector(random, 1.0e-3);
        AngularCoordinates ac = new AngularCoordinates(r, o);
        AngularCoordinates sum = ac.addOffset(ac.revert());
        Assert.assertEquals(0.0, sum.getRotation().getAngle(), 1.0e-15);
        Assert.assertEquals(0.0, sum.getRotationRate().getNorm(), 1.0e-15);
        Assert.assertEquals(0.0, sum.getRotationAcceleration().getNorm(), 1.0e-15);
    }
}
Also used : Vector3D(org.hipparchus.geometry.euclidean.threed.Vector3D) Rotation(org.hipparchus.geometry.euclidean.threed.Rotation) RandomGenerator(org.hipparchus.random.RandomGenerator) Well1024a(org.hipparchus.random.Well1024a) Test(org.junit.Test)

Example 28 with Well1024a

use of org.hipparchus.random.Well1024a in project Orekit by CS-SI.

the class AngularCoordinatesTest method testDerivativesStructures1.

@Test
public void testDerivativesStructures1() throws OrekitException {
    RandomGenerator random = new Well1024a(0x8f8fc6d27bbdc46dl);
    Rotation r = randomRotation(random);
    Vector3D o = randomVector(random, 1.0e-2);
    Vector3D oDot = randomVector(random, 1.0e-2);
    AngularCoordinates ac = new AngularCoordinates(r, o, oDot);
    AngularCoordinates rebuilt = new AngularCoordinates(ac.toDerivativeStructureRotation(1));
    Assert.assertEquals(0.0, Rotation.distance(ac.getRotation(), rebuilt.getRotation()), 1.0e-15);
    Assert.assertEquals(0.0, Vector3D.distance(ac.getRotationRate(), rebuilt.getRotationRate()), 1.0e-15);
    Assert.assertEquals(0.0, rebuilt.getRotationAcceleration().getNorm(), 1.0e-15);
}
Also used : Vector3D(org.hipparchus.geometry.euclidean.threed.Vector3D) Rotation(org.hipparchus.geometry.euclidean.threed.Rotation) RandomGenerator(org.hipparchus.random.RandomGenerator) Well1024a(org.hipparchus.random.Well1024a) Test(org.junit.Test)

Aggregations

Well1024a (org.hipparchus.random.Well1024a)28 Test (org.junit.Test)28 RandomGenerator (org.hipparchus.random.RandomGenerator)27 Vector3D (org.hipparchus.geometry.euclidean.threed.Vector3D)17 Rotation (org.hipparchus.geometry.euclidean.threed.Rotation)13 DerivativeStructure (org.hipparchus.analysis.differentiation.DerivativeStructure)9 GeodeticPoint (org.orekit.bodies.GeodeticPoint)2 ArrayList (java.util.ArrayList)1 ExecutorService (java.util.concurrent.ExecutorService)1 DSFactory (org.hipparchus.analysis.differentiation.DSFactory)1 S2Point (org.hipparchus.geometry.spherical.twod.S2Point)1 UnitSphereRandomVectorGenerator (org.hipparchus.random.UnitSphereRandomVectorGenerator)1 OneAxisEllipsoid (org.orekit.bodies.OneAxisEllipsoid)1 OrekitException (org.orekit.errors.OrekitException)1 AbsoluteDate (org.orekit.time.AbsoluteDate)1