Search in sources :

Example 41 with Decimal64

use of org.hipparchus.util.Decimal64 in project Orekit by CS-SI.

the class FieldPVCoordinatesTest method testToDerivativeStructurePV1.

@Test
public void testToDerivativeStructurePV1() throws OrekitException {
    FieldPVCoordinates<FieldDerivativeStructure<Decimal64>> fv = new FieldPVCoordinates<>(new FieldVector3D<>(new Decimal64(1), new Decimal64(0.1), new Decimal64(10)), new FieldVector3D<>(new Decimal64(-1), new Decimal64(-0.1), new Decimal64(-10)), new FieldVector3D<>(new Decimal64(10), new Decimal64(-1.0), new Decimal64(-100))).toDerivativeStructurePV(1);
    Assert.assertEquals(1, fv.getPosition().getX().getFreeParameters());
    Assert.assertEquals(1, fv.getPosition().getX().getOrder());
    Assert.assertEquals(1.0, fv.getPosition().getX().getReal(), 1.0e-10);
    Assert.assertEquals(0.1, fv.getPosition().getY().getReal(), 1.0e-10);
    Assert.assertEquals(10.0, fv.getPosition().getZ().getReal(), 1.0e-10);
    Assert.assertEquals(-1.0, fv.getVelocity().getX().getReal(), 1.0e-10);
    Assert.assertEquals(-0.1, fv.getVelocity().getY().getReal(), 1.0e-10);
    Assert.assertEquals(-10.0, fv.getVelocity().getZ().getReal(), 1.0e-10);
    Assert.assertEquals(10.0, fv.getAcceleration().getX().getReal(), 1.0e-10);
    Assert.assertEquals(-1.0, fv.getAcceleration().getY().getReal(), 1.0e-10);
    Assert.assertEquals(-100.0, fv.getAcceleration().getZ().getReal(), 1.0e-10);
    Assert.assertEquals(fv.getVelocity().getX().getReal(), fv.getPosition().getX().getPartialDerivative(1).getReal(), 1.0e-10);
    Assert.assertEquals(fv.getVelocity().getY().getReal(), fv.getPosition().getY().getPartialDerivative(1).getReal(), 1.0e-10);
    Assert.assertEquals(fv.getVelocity().getZ().getReal(), fv.getPosition().getZ().getPartialDerivative(1).getReal(), 1.0e-10);
    Assert.assertEquals(fv.getAcceleration().getX().getReal(), fv.getVelocity().getX().getPartialDerivative(1).getReal(), 1.0e-10);
    Assert.assertEquals(fv.getAcceleration().getY().getReal(), fv.getVelocity().getY().getPartialDerivative(1).getReal(), 1.0e-10);
    Assert.assertEquals(fv.getAcceleration().getZ().getReal(), fv.getVelocity().getZ().getPartialDerivative(1).getReal(), 1.0e-10);
}
Also used : Decimal64(org.hipparchus.util.Decimal64) FieldDerivativeStructure(org.hipparchus.analysis.differentiation.FieldDerivativeStructure) FieldVector3D(org.hipparchus.geometry.euclidean.threed.FieldVector3D) Test(org.junit.Test)

Aggregations

Decimal64 (org.hipparchus.util.Decimal64)41 Test (org.junit.Test)37 FieldVector3D (org.hipparchus.geometry.euclidean.threed.FieldVector3D)21 FieldAbsoluteDate (org.orekit.time.FieldAbsoluteDate)18 Vector3D (org.hipparchus.geometry.euclidean.threed.Vector3D)12 FieldDerivativeStructure (org.hipparchus.analysis.differentiation.FieldDerivativeStructure)10 AbsoluteDate (org.orekit.time.AbsoluteDate)9 RandomGenerator (org.hipparchus.random.RandomGenerator)5 Well19937a (org.hipparchus.random.Well19937a)5 GeodeticPoint (org.orekit.bodies.GeodeticPoint)4 OneAxisEllipsoid (org.orekit.bodies.OneAxisEllipsoid)4 Frame (org.orekit.frames.Frame)4 FieldCartesianOrbit (org.orekit.orbits.FieldCartesianOrbit)3 TimeScale (org.orekit.time.TimeScale)3 FieldPVCoordinates (org.orekit.utils.FieldPVCoordinates)3 PVCoordinates (org.orekit.utils.PVCoordinates)3 TimeStampedPVCoordinates (org.orekit.utils.TimeStampedPVCoordinates)3 DSFactory (org.hipparchus.analysis.differentiation.DSFactory)2 DerivativeStructure (org.hipparchus.analysis.differentiation.DerivativeStructure)2 CelestialBody (org.orekit.bodies.CelestialBody)2