Search in sources :

Example 41 with Rotation

use of org.hipparchus.geometry.euclidean.threed.Rotation in project Orekit by CS-SI.

the class TransformTest method testShiftDerivatives.

@Test
public void testShiftDerivatives() {
    RandomGenerator random = new Well19937a(0x5acda4f605aadce7l);
    for (int i = 0; i < 10; ++i) {
        Transform t = randomTransform(random);
        for (double dt = -10.0; dt < 10.0; dt += 0.125) {
            Transform t0 = t.shiftedBy(dt);
            double v = t0.getVelocity().getNorm();
            double a = t0.getAcceleration().getNorm();
            double omega = t0.getRotationRate().getNorm();
            double omegaDot = t0.getRotationAcceleration().getNorm();
            // numerical derivatives
            double h = 0.01 / omega;
            Transform tm4h = t.shiftedBy(dt - 4 * h);
            Transform tm3h = t.shiftedBy(dt - 3 * h);
            Transform tm2h = t.shiftedBy(dt - 2 * h);
            Transform tm1h = t.shiftedBy(dt - 1 * h);
            Transform tp1h = t.shiftedBy(dt + 1 * h);
            Transform tp2h = t.shiftedBy(dt + 2 * h);
            Transform tp3h = t.shiftedBy(dt + 3 * h);
            Transform tp4h = t.shiftedBy(dt + 4 * h);
            double numXDot = derivative(h, tm4h.getTranslation().getX(), tm3h.getTranslation().getX(), tm2h.getTranslation().getX(), tm1h.getTranslation().getX(), tp1h.getTranslation().getX(), tp2h.getTranslation().getX(), tp3h.getTranslation().getX(), tp4h.getTranslation().getX());
            double numYDot = derivative(h, tm4h.getTranslation().getY(), tm3h.getTranslation().getY(), tm2h.getTranslation().getY(), tm1h.getTranslation().getY(), tp1h.getTranslation().getY(), tp2h.getTranslation().getY(), tp3h.getTranslation().getY(), tp4h.getTranslation().getY());
            double numZDot = derivative(h, tm4h.getTranslation().getZ(), tm3h.getTranslation().getZ(), tm2h.getTranslation().getZ(), tm1h.getTranslation().getZ(), tp1h.getTranslation().getZ(), tp2h.getTranslation().getZ(), tp3h.getTranslation().getZ(), tp4h.getTranslation().getZ());
            double numXDot2 = derivative(h, tm4h.getVelocity().getX(), tm3h.getVelocity().getX(), tm2h.getVelocity().getX(), tm1h.getVelocity().getX(), tp1h.getVelocity().getX(), tp2h.getVelocity().getX(), tp3h.getVelocity().getX(), tp4h.getVelocity().getX());
            double numYDot2 = derivative(h, tm4h.getVelocity().getY(), tm3h.getVelocity().getY(), tm2h.getVelocity().getY(), tm1h.getVelocity().getY(), tp1h.getVelocity().getY(), tp2h.getVelocity().getY(), tp3h.getVelocity().getY(), tp4h.getVelocity().getY());
            double numZDot2 = derivative(h, tm4h.getVelocity().getZ(), tm3h.getVelocity().getZ(), tm2h.getVelocity().getZ(), tm1h.getVelocity().getZ(), tp1h.getVelocity().getZ(), tp2h.getVelocity().getZ(), tp3h.getVelocity().getZ(), tp4h.getVelocity().getZ());
            double numQ0Dot = derivative(h, tm4h.getRotation().getQ0(), tm3h.getRotation().getQ0(), tm2h.getRotation().getQ0(), tm1h.getRotation().getQ0(), tp1h.getRotation().getQ0(), tp2h.getRotation().getQ0(), tp3h.getRotation().getQ0(), tp4h.getRotation().getQ0());
            double numQ1Dot = derivative(h, tm4h.getRotation().getQ1(), tm3h.getRotation().getQ1(), tm2h.getRotation().getQ1(), tm1h.getRotation().getQ1(), tp1h.getRotation().getQ1(), tp2h.getRotation().getQ1(), tp3h.getRotation().getQ1(), tp4h.getRotation().getQ1());
            double numQ2Dot = derivative(h, tm4h.getRotation().getQ2(), tm3h.getRotation().getQ2(), tm2h.getRotation().getQ2(), tm1h.getRotation().getQ2(), tp1h.getRotation().getQ2(), tp2h.getRotation().getQ2(), tp3h.getRotation().getQ2(), tp4h.getRotation().getQ2());
            double numQ3Dot = derivative(h, tm4h.getRotation().getQ3(), tm3h.getRotation().getQ3(), tm2h.getRotation().getQ3(), tm1h.getRotation().getQ3(), tp1h.getRotation().getQ3(), tp2h.getRotation().getQ3(), tp3h.getRotation().getQ3(), tp4h.getRotation().getQ3());
            double numOxDot = derivative(h, tm4h.getRotationRate().getX(), tm3h.getRotationRate().getX(), tm2h.getRotationRate().getX(), tm1h.getRotationRate().getX(), tp1h.getRotationRate().getX(), tp2h.getRotationRate().getX(), tp3h.getRotationRate().getX(), tp4h.getRotationRate().getX());
            double numOyDot = derivative(h, tm4h.getRotationRate().getY(), tm3h.getRotationRate().getY(), tm2h.getRotationRate().getY(), tm1h.getRotationRate().getY(), tp1h.getRotationRate().getY(), tp2h.getRotationRate().getY(), tp3h.getRotationRate().getY(), tp4h.getRotationRate().getY());
            double numOzDot = derivative(h, tm4h.getRotationRate().getZ(), tm3h.getRotationRate().getZ(), tm2h.getRotationRate().getZ(), tm1h.getRotationRate().getZ(), tp1h.getRotationRate().getZ(), tp2h.getRotationRate().getZ(), tp3h.getRotationRate().getZ(), tp4h.getRotationRate().getZ());
            // theoretical derivatives
            double theXDot = t0.getVelocity().getX();
            double theYDot = t0.getVelocity().getY();
            double theZDot = t0.getVelocity().getZ();
            double theXDot2 = t0.getAcceleration().getX();
            double theYDot2 = t0.getAcceleration().getY();
            double theZDot2 = t0.getAcceleration().getZ();
            Rotation r0 = t0.getRotation();
            Vector3D w = t0.getRotationRate();
            Vector3D q = new Vector3D(r0.getQ1(), r0.getQ2(), r0.getQ3());
            Vector3D qw = Vector3D.crossProduct(q, w);
            double theQ0Dot = -0.5 * Vector3D.dotProduct(q, w);
            double theQ1Dot = 0.5 * (r0.getQ0() * w.getX() + qw.getX());
            double theQ2Dot = 0.5 * (r0.getQ0() * w.getY() + qw.getY());
            double theQ3Dot = 0.5 * (r0.getQ0() * w.getZ() + qw.getZ());
            double theOxDot2 = t0.getRotationAcceleration().getX();
            double theOyDot2 = t0.getRotationAcceleration().getY();
            double theOzDot2 = t0.getRotationAcceleration().getZ();
            // check consistency
            Assert.assertEquals(theXDot, numXDot, 1.0e-13 * v);
            Assert.assertEquals(theYDot, numYDot, 1.0e-13 * v);
            Assert.assertEquals(theZDot, numZDot, 1.0e-13 * v);
            Assert.assertEquals(theXDot2, numXDot2, 1.0e-13 * a);
            Assert.assertEquals(theYDot2, numYDot2, 1.0e-13 * a);
            Assert.assertEquals(theZDot2, numZDot2, 1.0e-13 * a);
            Assert.assertEquals(theQ0Dot, numQ0Dot, 1.0e-13 * omega);
            Assert.assertEquals(theQ1Dot, numQ1Dot, 1.0e-13 * omega);
            Assert.assertEquals(theQ2Dot, numQ2Dot, 1.0e-13 * omega);
            Assert.assertEquals(theQ3Dot, numQ3Dot, 1.0e-13 * omega);
            Assert.assertEquals(theOxDot2, numOxDot, 1.0e-12 * omegaDot);
            Assert.assertEquals(theOyDot2, numOyDot, 1.0e-12 * omegaDot);
            Assert.assertEquals(theOzDot2, numOzDot, 1.0e-12 * omegaDot);
        }
    }
}
Also used : FieldVector3D(org.hipparchus.geometry.euclidean.threed.FieldVector3D) Vector3D(org.hipparchus.geometry.euclidean.threed.Vector3D) Well19937a(org.hipparchus.random.Well19937a) Rotation(org.hipparchus.geometry.euclidean.threed.Rotation) RandomGenerator(org.hipparchus.random.RandomGenerator) Test(org.junit.Test)

Example 42 with Rotation

use of org.hipparchus.geometry.euclidean.threed.Rotation in project Orekit by CS-SI.

the class TransformTest method testRoughTransPV.

@Test
public void testRoughTransPV() {
    PVCoordinates pointP1 = new PVCoordinates(Vector3D.PLUS_I, Vector3D.PLUS_I, Vector3D.PLUS_I);
    // translation transform test
    PVCoordinates pointP2 = new PVCoordinates(new Vector3D(0, 0, 0), new Vector3D(0, 0, 0));
    Transform R1toR2 = new Transform(AbsoluteDate.J2000_EPOCH, Vector3D.MINUS_I, Vector3D.MINUS_I, Vector3D.MINUS_I);
    PVCoordinates result1 = R1toR2.transformPVCoordinates(pointP1);
    checkVector(pointP2.getPosition(), result1.getPosition(), 1.0e-15);
    checkVector(pointP2.getVelocity(), result1.getVelocity(), 1.0e-15);
    checkVector(pointP2.getAcceleration(), result1.getAcceleration(), 1.0e-15);
    // test inverse translation
    Transform R2toR1 = R1toR2.getInverse();
    PVCoordinates invResult1 = R2toR1.transformPVCoordinates(pointP2);
    checkVector(pointP1.getPosition(), invResult1.getPosition(), 1.0e-15);
    checkVector(pointP1.getVelocity(), invResult1.getVelocity(), 1.0e-15);
    checkVector(pointP1.getAcceleration(), invResult1.getAcceleration(), 1.0e-15);
    // rotation transform test
    PVCoordinates pointP3 = new PVCoordinates(Vector3D.PLUS_J, new Vector3D(-2, 1, 0), new Vector3D(-4, -3, -1));
    Rotation R = new Rotation(Vector3D.PLUS_K, FastMath.PI / 2, RotationConvention.VECTOR_OPERATOR);
    Transform R1toR3 = new Transform(AbsoluteDate.J2000_EPOCH, R, new Vector3D(0, 0, -2), new Vector3D(1, 0, 0));
    PVCoordinates result2 = R1toR3.transformPVCoordinates(pointP1);
    checkVector(pointP3.getPosition(), result2.getPosition(), 1.0e-15);
    checkVector(pointP3.getVelocity(), result2.getVelocity(), 1.0e-15);
    checkVector(pointP3.getAcceleration(), result2.getAcceleration(), 1.0e-15);
    // test inverse rotation
    Transform R3toR1 = R1toR3.getInverse();
    PVCoordinates invResult2 = R3toR1.transformPVCoordinates(pointP3);
    checkVector(pointP1.getPosition(), invResult2.getPosition(), 1.0e-15);
    checkVector(pointP1.getVelocity(), invResult2.getVelocity(), 1.0e-15);
    checkVector(pointP1.getAcceleration(), invResult2.getAcceleration(), 1.0e-15);
    // combine 2 velocity transform
    Transform R1toR4 = new Transform(AbsoluteDate.J2000_EPOCH, new Vector3D(-2, 0, 0), new Vector3D(-2, 0, 0), new Vector3D(-2, 0, 0));
    PVCoordinates pointP4 = new PVCoordinates(new Vector3D(-1, 0, 0), new Vector3D(-1, 0, 0), new Vector3D(-1, 0, 0));
    Transform R2toR4 = new Transform(AbsoluteDate.J2000_EPOCH, R2toR1, R1toR4);
    PVCoordinates compResult = R2toR4.transformPVCoordinates(pointP2);
    checkVector(pointP4.getPosition(), compResult.getPosition(), 1.0e-15);
    checkVector(pointP4.getVelocity(), compResult.getVelocity(), 1.0e-15);
    checkVector(pointP4.getAcceleration(), compResult.getAcceleration(), 1.0e-15);
    // combine 2 rotation tranform
    PVCoordinates pointP5 = new PVCoordinates(new Vector3D(-1, 0, 0), new Vector3D(-1, 0, 3), new Vector3D(8, 0, 6));
    Rotation R2 = new Rotation(new Vector3D(0, 0, 1), FastMath.PI, RotationConvention.VECTOR_OPERATOR);
    Transform R1toR5 = new Transform(AbsoluteDate.J2000_EPOCH, R2, new Vector3D(0, -3, 0));
    Transform R3toR5 = new Transform(AbsoluteDate.J2000_EPOCH, R3toR1, R1toR5);
    PVCoordinates combResult = R3toR5.transformPVCoordinates(pointP3);
    checkVector(pointP5.getPosition(), combResult.getPosition(), 1.0e-15);
    checkVector(pointP5.getVelocity(), combResult.getVelocity(), 1.0e-15);
    checkVector(pointP5.getAcceleration(), combResult.getAcceleration(), 1.0e-15);
    // combine translation and rotation
    Transform R2toR3 = new Transform(AbsoluteDate.J2000_EPOCH, R2toR1, R1toR3);
    PVCoordinates result = R2toR3.transformPVCoordinates(pointP2);
    checkVector(pointP3.getPosition(), result.getPosition(), 1.0e-15);
    checkVector(pointP3.getVelocity(), result.getVelocity(), 1.0e-15);
    checkVector(pointP3.getAcceleration(), result.getAcceleration(), 1.0e-15);
    Transform R3toR2 = new Transform(AbsoluteDate.J2000_EPOCH, R3toR1, R1toR2);
    result = R3toR2.transformPVCoordinates(pointP3);
    checkVector(pointP2.getPosition(), result.getPosition(), 1.0e-15);
    checkVector(pointP2.getVelocity(), result.getVelocity(), 1.0e-15);
    checkVector(pointP2.getAcceleration(), result.getAcceleration(), 1.0e-15);
    Transform newR1toR5 = new Transform(AbsoluteDate.J2000_EPOCH, R1toR2, R2toR3);
    newR1toR5 = new Transform(AbsoluteDate.J2000_EPOCH, newR1toR5, R3toR5);
    result = newR1toR5.transformPVCoordinates(pointP1);
    checkVector(pointP5.getPosition(), result.getPosition(), 1.0e-15);
    checkVector(pointP5.getVelocity(), result.getVelocity(), 1.0e-15);
    checkVector(pointP5.getAcceleration(), result.getAcceleration(), 1.0e-15);
    // more tests
    newR1toR5 = new Transform(AbsoluteDate.J2000_EPOCH, R1toR2, R2toR3);
    Transform R3toR4 = new Transform(AbsoluteDate.J2000_EPOCH, R3toR1, R1toR4);
    newR1toR5 = new Transform(AbsoluteDate.J2000_EPOCH, newR1toR5, R3toR4);
    Transform R4toR5 = new Transform(AbsoluteDate.J2000_EPOCH, R1toR4.getInverse(), R1toR5);
    newR1toR5 = new Transform(AbsoluteDate.J2000_EPOCH, newR1toR5, R4toR5);
    result = newR1toR5.transformPVCoordinates(pointP1);
    checkVector(pointP5.getPosition(), result.getPosition(), 1.0e-15);
    checkVector(pointP5.getVelocity(), result.getVelocity(), 1.0e-15);
    checkVector(pointP5.getAcceleration(), result.getAcceleration(), 1.0e-15);
}
Also used : FieldVector3D(org.hipparchus.geometry.euclidean.threed.FieldVector3D) Vector3D(org.hipparchus.geometry.euclidean.threed.Vector3D) TimeStampedPVCoordinates(org.orekit.utils.TimeStampedPVCoordinates) FieldPVCoordinates(org.orekit.utils.FieldPVCoordinates) PVCoordinates(org.orekit.utils.PVCoordinates) TimeStampedFieldPVCoordinates(org.orekit.utils.TimeStampedFieldPVCoordinates) Rotation(org.hipparchus.geometry.euclidean.threed.Rotation) Test(org.junit.Test)

Example 43 with Rotation

use of org.hipparchus.geometry.euclidean.threed.Rotation in project Orekit by CS-SI.

the class TransformTest method testAccelerationComposition.

@Test
public void testAccelerationComposition() {
    RandomGenerator random = new Well19937a(0x41fdd07d6c9e9f65l);
    Vector3D p1 = randomVector(1.0e3, random);
    Vector3D v1 = randomVector(1.0, random);
    Vector3D a1 = randomVector(1.0e-3, random);
    Rotation r1 = randomRotation(random);
    Vector3D o1 = randomVector(0.1, random);
    Vector3D p2 = randomVector(1.0e3, random);
    Vector3D v2 = randomVector(1.0, random);
    Vector3D a2 = randomVector(1.0e-3, random);
    Rotation r2 = randomRotation(random);
    Vector3D o2 = randomVector(0.1, random);
    Transform t1 = new Transform(AbsoluteDate.J2000_EPOCH, new Transform(AbsoluteDate.J2000_EPOCH, p1, v1, a1), new Transform(AbsoluteDate.J2000_EPOCH, r1, o1));
    Transform t2 = new Transform(AbsoluteDate.J2000_EPOCH, new Transform(AbsoluteDate.J2000_EPOCH, p2, v2, a2), new Transform(AbsoluteDate.J2000_EPOCH, r2, o2));
    Transform t12 = new Transform(AbsoluteDate.J2000_EPOCH, t1, t2);
    Vector3D q = randomVector(1.0e3, random);
    Vector3D qDot = randomVector(1.0, random);
    Vector3D qDotDot = randomVector(1.0e-3, random);
    PVCoordinates pva0 = new PVCoordinates(q, qDot, qDotDot);
    PVCoordinates pva1 = t1.transformPVCoordinates(pva0);
    PVCoordinates pva2 = t2.transformPVCoordinates(pva1);
    PVCoordinates pvac = t12.transformPVCoordinates(pva0);
    checkVector(pva2.getPosition(), pvac.getPosition(), 1.0e-15);
    checkVector(pva2.getVelocity(), pvac.getVelocity(), 1.0e-15);
    checkVector(pva2.getAcceleration(), pvac.getAcceleration(), 1.0e-15);
    // despite neither raw transforms have angular acceleration,
    // the combination does have an angular acceleration,
    // it is due to the cross product Ω₁ ⨯ Ω₂
    Assert.assertEquals(0.0, t1.getAngular().getRotationAcceleration().getNorm(), 1.0e-15);
    Assert.assertEquals(0.0, t2.getAngular().getRotationAcceleration().getNorm(), 1.0e-15);
    Assert.assertTrue(t12.getAngular().getRotationAcceleration().getNorm() > 0.01);
    Assert.assertEquals(0.0, t12.freeze().getCartesian().getVelocity().getNorm(), 1.0e-15);
    Assert.assertEquals(0.0, t12.freeze().getCartesian().getAcceleration().getNorm(), 1.0e-15);
    Assert.assertEquals(0.0, t12.freeze().getAngular().getRotationRate().getNorm(), 1.0e-15);
    Assert.assertEquals(0.0, t12.freeze().getAngular().getRotationAcceleration().getNorm(), 1.0e-15);
}
Also used : FieldVector3D(org.hipparchus.geometry.euclidean.threed.FieldVector3D) Vector3D(org.hipparchus.geometry.euclidean.threed.Vector3D) TimeStampedPVCoordinates(org.orekit.utils.TimeStampedPVCoordinates) FieldPVCoordinates(org.orekit.utils.FieldPVCoordinates) PVCoordinates(org.orekit.utils.PVCoordinates) TimeStampedFieldPVCoordinates(org.orekit.utils.TimeStampedFieldPVCoordinates) Well19937a(org.hipparchus.random.Well19937a) Rotation(org.hipparchus.geometry.euclidean.threed.Rotation) RandomGenerator(org.hipparchus.random.RandomGenerator) Test(org.junit.Test)

Example 44 with Rotation

use of org.hipparchus.geometry.euclidean.threed.Rotation in project Orekit by CS-SI.

the class TODProviderTest method testAASReferenceLEO.

@Test
public void testAASReferenceLEO() throws OrekitException {
    // this reference test has been extracted from the following paper:
    // Implementation Issues Surrounding the New IAU Reference Systems for Astrodynamics
    // David A. Vallado, John H. Seago, P. Kenneth Seidelmann
    // http://www.centerforspace.com/downloads/files/pubs/AAS-06-134.pdf
    Utils.setLoaders(IERSConventions.IERS_1996, Utils.buildEOPList(IERSConventions.IERS_1996, ITRFVersion.ITRF_2008, new double[][] { { 53098, -0.4399619, 0.0015563, -0.140682, 0.333309, -0.052195, -0.003875, Double.NaN, Double.NaN }, { 53099, -0.4399619, 0.0015563, -0.140682, 0.333309, -0.052195, -0.003875, Double.NaN, Double.NaN }, { 53100, -0.4399619, 0.0015563, -0.140682, 0.333309, -0.052195, -0.003875, Double.NaN, Double.NaN }, { 53101, -0.4399619, 0.0015563, -0.140682, 0.333309, -0.052195, -0.003875, Double.NaN, Double.NaN }, { 53102, -0.4399619, 0.0015563, -0.140682, 0.333309, -0.052195, -0.003875, Double.NaN, Double.NaN }, { 53103, -0.4399619, 0.0015563, -0.140682, 0.333309, -0.052195, -0.003875, Double.NaN, Double.NaN }, { 53104, -0.4399619, 0.0015563, -0.140682, 0.333309, -0.052195, -0.003875, Double.NaN, Double.NaN }, { 53105, -0.4399619, 0.0015563, -0.140682, 0.333309, -0.052195, -0.003875, Double.NaN, Double.NaN } }));
    AbsoluteDate t0 = new AbsoluteDate(new DateComponents(2004, 04, 06), new TimeComponents(07, 51, 28.386009), TimeScalesFactory.getUTC());
    Transform tt = FramesFactory.getMOD(IERSConventions.IERS_1996).getTransformTo(FramesFactory.getTOD(IERSConventions.IERS_1996, true), t0);
    Transform ff = FramesFactory.getMOD(false).getTransformTo(FramesFactory.getTOD(false), t0);
    // TOD iau76
    PVCoordinates pvTODiau76 = new PVCoordinates(new Vector3D(5094514.7804, 6127366.4612, 6380344.5328), new Vector3D(-4746.088567, 786.077222, 5531.931288));
    // MOD iau76
    PVCoordinates pvMODiau76WithoutNutCorr = new PVCoordinates(new Vector3D(5094029.0167, 6127870.9363, 6380247.8885), new Vector3D(-4746.262495, 786.014149, 5531.791025));
    // MOD iau76
    PVCoordinates pvMODiau76 = new PVCoordinates(new Vector3D(5094028.3745, 6127870.8164, 6380248.5164), new Vector3D(-4746.263052, 786.014045, 5531.790562));
    // it seems the induced effect of pole nutation correction δΔψ on the equation of the equinoxes
    // was not taken into account in the reference paper, so we fix it here for the test
    final double dDeltaPsi = FramesFactory.getEOPHistory(IERSConventions.IERS_1996, true).getEquinoxNutationCorrection(t0)[0];
    final double epsilonA = IERSConventions.IERS_1996.getMeanObliquityFunction().value(t0);
    final Transform fix = new Transform(t0, new Rotation(Vector3D.PLUS_K, dDeltaPsi * FastMath.cos(epsilonA), RotationConvention.FRAME_TRANSFORM));
    checkPV(pvTODiau76, fix.transformPVCoordinates(tt.transformPVCoordinates(pvMODiau76)), 1.13e-3, 5.3e-5);
    checkPV(pvTODiau76, ff.transformPVCoordinates(pvMODiau76WithoutNutCorr), 1.07e-3, 5.3e-5);
}
Also used : Vector3D(org.hipparchus.geometry.euclidean.threed.Vector3D) PVCoordinates(org.orekit.utils.PVCoordinates) DateComponents(org.orekit.time.DateComponents) TimeComponents(org.orekit.time.TimeComponents) Rotation(org.hipparchus.geometry.euclidean.threed.Rotation) AbsoluteDate(org.orekit.time.AbsoluteDate) Test(org.junit.Test)

Example 45 with Rotation

use of org.hipparchus.geometry.euclidean.threed.Rotation in project Orekit by CS-SI.

the class MODProviderTest method testEuler2000.

@Test
public void testEuler2000() throws OrekitException {
    // this alternate representation of the transform
    // is from equation 33 in IERS conventions 2003
    TransformProvider eulerBasedProvider = new TransformProvider() {

        private static final long serialVersionUID = 1L;

        private final PolynomialNutation zetaA = new PolynomialNutation(2.5976176 * Constants.ARC_SECONDS_TO_RADIANS, 2306.0809506 * Constants.ARC_SECONDS_TO_RADIANS, 0.3019015 * Constants.ARC_SECONDS_TO_RADIANS, 0.0179663 * Constants.ARC_SECONDS_TO_RADIANS, -0.0000327 * Constants.ARC_SECONDS_TO_RADIANS, -0.0000002 * Constants.ARC_SECONDS_TO_RADIANS);

        private final PolynomialNutation thetaA = new PolynomialNutation(0.0, 2004.1917476 * Constants.ARC_SECONDS_TO_RADIANS, -0.4269353 * Constants.ARC_SECONDS_TO_RADIANS, -0.0418251 * Constants.ARC_SECONDS_TO_RADIANS, -0.0000601 * Constants.ARC_SECONDS_TO_RADIANS, -0.0000001 * Constants.ARC_SECONDS_TO_RADIANS);

        private final PolynomialNutation zA = new PolynomialNutation(-2.5976176 * Constants.ARC_SECONDS_TO_RADIANS, 2306.0803226 * Constants.ARC_SECONDS_TO_RADIANS, 1.0947790 * Constants.ARC_SECONDS_TO_RADIANS, 0.0182273 * Constants.ARC_SECONDS_TO_RADIANS, 0.0000470 * Constants.ARC_SECONDS_TO_RADIANS, -0.0000003 * Constants.ARC_SECONDS_TO_RADIANS);

        public Transform getTransform(AbsoluteDate date) {
            final double tc = IERSConventions.IERS_2003.evaluateTC(date);
            final Rotation r1 = new Rotation(Vector3D.PLUS_K, zA.value(tc), RotationConvention.VECTOR_OPERATOR);
            final Rotation r2 = new Rotation(Vector3D.PLUS_J, -thetaA.value(tc), RotationConvention.VECTOR_OPERATOR);
            final Rotation r3 = new Rotation(Vector3D.PLUS_K, zetaA.value(tc), RotationConvention.VECTOR_OPERATOR);
            return new Transform(date, r1.compose(r2.compose(r3, RotationConvention.VECTOR_OPERATOR), RotationConvention.VECTOR_OPERATOR));
        }

        public <T extends RealFieldElement<T>> FieldTransform<T> getTransform(final FieldAbsoluteDate<T> date) {
            throw new UnsupportedOperationException("never called in this test");
        }
    };
    MODProvider modProvider = new MODProvider(IERSConventions.IERS_2003);
    for (double dt = -Constants.JULIAN_CENTURY; dt < Constants.JULIAN_CENTURY; dt += 50 * Constants.JULIAN_DAY) {
        AbsoluteDate date = AbsoluteDate.J2000_EPOCH.shiftedBy(dt);
        Transform t = new Transform(date, modProvider.getTransform(date).getInverse(), eulerBasedProvider.getTransform(date));
        Assert.assertEquals(0, t.getRotation().getAngle(), 6.6e-13);
    }
}
Also used : RealFieldElement(org.hipparchus.RealFieldElement) PolynomialNutation(org.orekit.data.PolynomialNutation) Rotation(org.hipparchus.geometry.euclidean.threed.Rotation) FieldAbsoluteDate(org.orekit.time.FieldAbsoluteDate) FieldAbsoluteDate(org.orekit.time.FieldAbsoluteDate) AbsoluteDate(org.orekit.time.AbsoluteDate) Test(org.junit.Test)

Aggregations

Rotation (org.hipparchus.geometry.euclidean.threed.Rotation)145 Vector3D (org.hipparchus.geometry.euclidean.threed.Vector3D)116 Test (org.junit.Test)100 AbsoluteDate (org.orekit.time.AbsoluteDate)55 FieldVector3D (org.hipparchus.geometry.euclidean.threed.FieldVector3D)53 FieldRotation (org.hipparchus.geometry.euclidean.threed.FieldRotation)43 FieldAbsoluteDate (org.orekit.time.FieldAbsoluteDate)38 PVCoordinates (org.orekit.utils.PVCoordinates)30 SpacecraftState (org.orekit.propagation.SpacecraftState)26 DateComponents (org.orekit.time.DateComponents)22 Frame (org.orekit.frames.Frame)21 KeplerianOrbit (org.orekit.orbits.KeplerianOrbit)21 RandomGenerator (org.hipparchus.random.RandomGenerator)19 Transform (org.orekit.frames.Transform)19 FieldPVCoordinates (org.orekit.utils.FieldPVCoordinates)19 CircularOrbit (org.orekit.orbits.CircularOrbit)18 TimeComponents (org.orekit.time.TimeComponents)17 TimeStampedPVCoordinates (org.orekit.utils.TimeStampedPVCoordinates)16 GeodeticPoint (org.orekit.bodies.GeodeticPoint)15 OneAxisEllipsoid (org.orekit.bodies.OneAxisEllipsoid)14