Search in sources :

Example 1 with RotationOrder

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

the class LofOffsetPointingTest method testTypesField.

@Test
public void testTypesField() throws OrekitException {
    AbsoluteDate date = new AbsoluteDate(new DateComponents(1970, 01, 01), new TimeComponents(3, 25, 45.6789), TimeScalesFactory.getUTC());
    KeplerianOrbit orbit = new KeplerianOrbit(7178000.0, 1.e-4, FastMath.toRadians(50.), FastMath.toRadians(10.), FastMath.toRadians(20.), FastMath.toRadians(30.), PositionAngle.MEAN, FramesFactory.getEME2000(), date, 3.986004415e14);
    for (final LOFType type : LOFType.values()) {
        RotationOrder order = RotationOrder.ZXY;
        double alpha1 = 0.123;
        double alpha2 = 0.456;
        double alpha3 = 0.789;
        LofOffset law = new LofOffset(orbit.getFrame(), type, order, alpha1, alpha2, alpha3);
        final Vector3D dir;
        switch(type) {
            case TNW:
                dir = Vector3D.PLUS_J;
                break;
            case QSW:
            case LVLH:
                dir = Vector3D.MINUS_I;
                break;
            case VVLH:
                dir = Vector3D.PLUS_K;
                break;
            default:
                // VNC
                dir = Vector3D.MINUS_K;
        }
        LofOffsetPointing lop = new LofOffsetPointing(orbit.getFrame(), earthSpheric, law, dir);
        checkField(Decimal64Field.getInstance(), lop, orbit, date, orbit.getFrame());
    }
}
Also used : Vector3D(org.hipparchus.geometry.euclidean.threed.Vector3D) LOFType(org.orekit.frames.LOFType) RotationOrder(org.hipparchus.geometry.euclidean.threed.RotationOrder) DateComponents(org.orekit.time.DateComponents) KeplerianOrbit(org.orekit.orbits.KeplerianOrbit) TimeComponents(org.orekit.time.TimeComponents) FieldAbsoluteDate(org.orekit.time.FieldAbsoluteDate) AbsoluteDate(org.orekit.time.AbsoluteDate) Test(org.junit.Test)

Example 2 with RotationOrder

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

the class LofOffsetTest method testRetrieveAngles.

@Test
public void testRetrieveAngles() throws OrekitException {
    AbsoluteDate date = new AbsoluteDate(new DateComponents(1970, 01, 01), new TimeComponents(3, 25, 45.6789), TimeScalesFactory.getUTC());
    KeplerianOrbit orbit = new KeplerianOrbit(7178000.0, 1.e-4, FastMath.toRadians(50.), FastMath.toRadians(10.), FastMath.toRadians(20.), FastMath.toRadians(30.), PositionAngle.MEAN, FramesFactory.getEME2000(), date, 3.986004415e14);
    RotationOrder order = RotationOrder.ZXY;
    double alpha1 = 0.123;
    double alpha2 = 0.456;
    double alpha3 = 0.789;
    LofOffset law = new LofOffset(orbit.getFrame(), LOFType.VVLH, order, alpha1, alpha2, alpha3);
    Rotation offsetAtt = law.getAttitude(orbit, date, orbit.getFrame()).getRotation();
    Rotation alignedAtt = new LofOffset(orbit.getFrame(), LOFType.VVLH).getAttitude(orbit, date, orbit.getFrame()).getRotation();
    Rotation offsetProper = offsetAtt.compose(alignedAtt.revert(), RotationConvention.VECTOR_OPERATOR);
    double[] anglesV = offsetProper.revert().getAngles(order, RotationConvention.VECTOR_OPERATOR);
    Assert.assertEquals(alpha1, anglesV[0], 1.0e-11);
    Assert.assertEquals(alpha2, anglesV[1], 1.0e-11);
    Assert.assertEquals(alpha3, anglesV[2], 1.0e-11);
    double[] anglesF = offsetProper.getAngles(order, RotationConvention.FRAME_TRANSFORM);
    Assert.assertEquals(alpha1, anglesF[0], 1.0e-11);
    Assert.assertEquals(alpha2, anglesF[1], 1.0e-11);
    Assert.assertEquals(alpha3, anglesF[2], 1.0e-11);
}
Also used : RotationOrder(org.hipparchus.geometry.euclidean.threed.RotationOrder) DateComponents(org.orekit.time.DateComponents) KeplerianOrbit(org.orekit.orbits.KeplerianOrbit) TimeComponents(org.orekit.time.TimeComponents) Rotation(org.hipparchus.geometry.euclidean.threed.Rotation) FieldAbsoluteDate(org.orekit.time.FieldAbsoluteDate) AbsoluteDate(org.orekit.time.AbsoluteDate) Test(org.junit.Test)

Example 3 with RotationOrder

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

the class LofOffsetTest method testTypesField.

@Test
public void testTypesField() throws OrekitException {
    AbsoluteDate date = new AbsoluteDate(new DateComponents(1970, 01, 01), new TimeComponents(3, 25, 45.6789), TimeScalesFactory.getUTC());
    KeplerianOrbit orbit = new KeplerianOrbit(7178000.0, 1.e-4, FastMath.toRadians(50.), FastMath.toRadians(10.), FastMath.toRadians(20.), FastMath.toRadians(30.), PositionAngle.MEAN, FramesFactory.getEME2000(), date, 3.986004415e14);
    for (final LOFType type : LOFType.values()) {
        RotationOrder order = RotationOrder.ZXY;
        double alpha1 = 0.123;
        double alpha2 = 0.456;
        double alpha3 = 0.789;
        LofOffset law = new LofOffset(orbit.getFrame(), type, order, alpha1, alpha2, alpha3);
        checkField(Decimal64Field.getInstance(), law, orbit, date, orbit.getFrame());
    }
}
Also used : LOFType(org.orekit.frames.LOFType) RotationOrder(org.hipparchus.geometry.euclidean.threed.RotationOrder) DateComponents(org.orekit.time.DateComponents) KeplerianOrbit(org.orekit.orbits.KeplerianOrbit) TimeComponents(org.orekit.time.TimeComponents) FieldAbsoluteDate(org.orekit.time.FieldAbsoluteDate) AbsoluteDate(org.orekit.time.AbsoluteDate) Test(org.junit.Test)

Aggregations

RotationOrder (org.hipparchus.geometry.euclidean.threed.RotationOrder)3 Test (org.junit.Test)3 KeplerianOrbit (org.orekit.orbits.KeplerianOrbit)3 AbsoluteDate (org.orekit.time.AbsoluteDate)3 DateComponents (org.orekit.time.DateComponents)3 FieldAbsoluteDate (org.orekit.time.FieldAbsoluteDate)3 TimeComponents (org.orekit.time.TimeComponents)3 LOFType (org.orekit.frames.LOFType)2 Rotation (org.hipparchus.geometry.euclidean.threed.Rotation)1 Vector3D (org.hipparchus.geometry.euclidean.threed.Vector3D)1