Search in sources :

Example 86 with RandomGenerator

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

the class TransformProviderUtilTest method testIdentity.

@Test
public void testIdentity() throws OrekitException {
    RandomGenerator random = new Well19937a(0x87c3a5c51fb0235el);
    final AbsoluteDate date = AbsoluteDate.J2000_EPOCH;
    checkNoTransform(TransformProviderUtils.IDENTITY_PROVIDER.getTransform(date), random);
}
Also used : Well19937a(org.hipparchus.random.Well19937a) RandomGenerator(org.hipparchus.random.RandomGenerator) FieldAbsoluteDate(org.orekit.time.FieldAbsoluteDate) AbsoluteDate(org.orekit.time.AbsoluteDate) Test(org.junit.Test)

Example 87 with RandomGenerator

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

the class TransformProviderUtilTest method testReverseField.

@Test
public void testReverseField() throws OrekitException {
    RandomGenerator random = new Well19937a(0xd74443b3079403e7l);
    final FieldAbsoluteDate<Decimal64> date = new FieldAbsoluteDate<>(Decimal64Field.getInstance(), AbsoluteDate.J2000_EPOCH);
    for (int i = 0; i < 20; ++i) {
        TransformProvider tp = constantProvider(random);
        TransformProvider reversed = TransformProviderUtils.getReversedProvider(tp);
        checkNoTransform(new FieldTransform<>(date, tp.getTransform(date), reversed.getTransform(date)), random);
        checkNoTransform(new FieldTransform<>(date, reversed.getTransform(date), tp.getTransform(date)), random);
    }
}
Also used : Decimal64(org.hipparchus.util.Decimal64) Well19937a(org.hipparchus.random.Well19937a) FieldAbsoluteDate(org.orekit.time.FieldAbsoluteDate) RandomGenerator(org.hipparchus.random.RandomGenerator) Test(org.junit.Test)

Example 88 with RandomGenerator

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

the class TransformProviderUtilTest method testCombine.

@Test
public void testCombine() throws OrekitException {
    RandomGenerator random = new Well19937a(0x6e3b2c793680e7e3l);
    final AbsoluteDate date = AbsoluteDate.J2000_EPOCH;
    for (int i = 0; i < 20; ++i) {
        TransformProvider first = constantProvider(random);
        TransformProvider second = constantProvider(random);
        TransformProvider combined = TransformProviderUtils.getCombinedProvider(first, second);
        checkNoTransform(new Transform(date, new Transform(date, first.getTransform(date), second.getTransform(date)).getInverse(), combined.getTransform(date)), random);
    }
}
Also used : Well19937a(org.hipparchus.random.Well19937a) RandomGenerator(org.hipparchus.random.RandomGenerator) FieldAbsoluteDate(org.orekit.time.FieldAbsoluteDate) AbsoluteDate(org.orekit.time.AbsoluteDate) Test(org.junit.Test)

Example 89 with RandomGenerator

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

the class FieldAngularCoordinatesTest method testRandomInverseCrossProducts.

@Test
public void testRandomInverseCrossProducts() throws OrekitException {
    RandomGenerator generator = new Well1024a(0xda0ee5b245efd438l);
    for (int i = 0; i < 10000; ++i) {
        FieldVector3D<DerivativeStructure> omega = randomVector(generator, 10 * generator.nextDouble() + 1.0);
        FieldVector3D<DerivativeStructure> v1 = randomVector(generator, 10 * generator.nextDouble() + 1.0);
        FieldVector3D<DerivativeStructure> v2 = randomVector(generator, 10 * generator.nextDouble() + 1.0);
        checkInverse(omega, v1, v2);
    }
}
Also used : DerivativeStructure(org.hipparchus.analysis.differentiation.DerivativeStructure) RandomGenerator(org.hipparchus.random.RandomGenerator) Well1024a(org.hipparchus.random.Well1024a) Test(org.junit.Test)

Example 90 with RandomGenerator

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

the class FieldAngularCoordinatesTest method testReverseOffset.

@Test
public void testReverseOffset() {
    RandomGenerator random = new Well1024a(0x4ecca9d57a8f1611l);
    for (int i = 0; i < 100; ++i) {
        FieldRotation<DerivativeStructure> r = randomRotation(random);
        FieldVector3D<DerivativeStructure> o = randomVector(random, 1.0e-3);
        FieldVector3D<DerivativeStructure> a = randomVector(random, 1.0e-3);
        FieldAngularCoordinates<DerivativeStructure> ac = new FieldAngularCoordinates<>(r, o, a);
        FieldAngularCoordinates<DerivativeStructure> sum = ac.addOffset(ac.revert());
        Assert.assertEquals(0.0, sum.getRotation().getAngle().getReal(), 1.0e-15);
        Assert.assertEquals(0.0, sum.getRotationRate().getNorm().getReal(), 1.0e-15);
    }
}
Also used : DerivativeStructure(org.hipparchus.analysis.differentiation.DerivativeStructure) RandomGenerator(org.hipparchus.random.RandomGenerator) Well1024a(org.hipparchus.random.Well1024a) Test(org.junit.Test)

Aggregations

RandomGenerator (org.hipparchus.random.RandomGenerator)100 Test (org.junit.Test)78 Well19937a (org.hipparchus.random.Well19937a)73 Vector3D (org.hipparchus.geometry.euclidean.threed.Vector3D)33 Well1024a (org.hipparchus.random.Well1024a)27 DerivativeStructure (org.hipparchus.analysis.differentiation.DerivativeStructure)22 FieldPVCoordinates (org.orekit.utils.FieldPVCoordinates)22 GeodeticPoint (org.orekit.bodies.GeodeticPoint)20 Rotation (org.hipparchus.geometry.euclidean.threed.Rotation)19 PVCoordinates (org.orekit.utils.PVCoordinates)15 TimeStampedFieldPVCoordinates (org.orekit.utils.TimeStampedFieldPVCoordinates)15 DSFactory (org.hipparchus.analysis.differentiation.DSFactory)14 FieldVector3D (org.hipparchus.geometry.euclidean.threed.FieldVector3D)14 FieldAbsoluteDate (org.orekit.time.FieldAbsoluteDate)14 Frame (org.orekit.frames.Frame)10 GaussianRandomGenerator (org.hipparchus.random.GaussianRandomGenerator)8 UncorrelatedRandomVectorGenerator (org.hipparchus.random.UncorrelatedRandomVectorGenerator)8 FieldKeplerianOrbit (org.orekit.orbits.FieldKeplerianOrbit)8 OrbitType (org.orekit.orbits.OrbitType)8 FieldSpacecraftState (org.orekit.propagation.FieldSpacecraftState)8