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);
}
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);
}
}
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);
}
}
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);
}
}
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);
}
}
Aggregations