use of org.orekit.bodies.CelestialBody in project Orekit by CS-SI.
the class L2TransformProviderTest method testTransformationOrientationForEarthMoon.
@Test
public void testTransformationOrientationForEarthMoon() throws OrekitException {
// Load Bodies
final CelestialBody earth = CelestialBodyFactory.getEarth();
final CelestialBody moon = CelestialBodyFactory.getMoon();
// Set framesd
final Frame eme2000 = FramesFactory.getEME2000();
final Frame l2Frame = new L2Frame(earth, moon);
// Time settings
final AbsoluteDate date = new AbsoluteDate(2000, 01, 01, 0, 0, 00.000, TimeScalesFactory.getUTC());
// Compute Moon position in EME2000
PVCoordinates pvMoon = moon.getPVCoordinates(date, eme2000);
Vector3D posMoon = pvMoon.getPosition();
// Compute L2 position in EME2000
// (it is important to use transformPosition(Vector3D.ZERO) and *not* getTranslation()
// because the test should avoid doing wrong interpretation of the meaning and
// particularly on the sign of the translation)
Vector3D posL2 = l2Frame.getTransformTo(eme2000, date).transformPosition(Vector3D.ZERO);
// check L2 and Moon are aligned as seen from Earth
Assert.assertEquals(0.0, Vector3D.angle(posMoon, posL2), 1.0e-10);
// check L2 if at least 60 000km farther than Moon
Assert.assertTrue(posL2.getNorm() > posMoon.getNorm() + 6.0e7);
}
use of org.orekit.bodies.CelestialBody in project Orekit by CS-SI.
the class L2TransformProviderTest method testL2Orientation.
@Test
public void testL2Orientation() throws OrekitException {
final AbsoluteDate date0 = new AbsoluteDate(2000, 01, 1, 11, 58, 20.000, TimeScalesFactory.getUTC());
final CelestialBody sun = CelestialBodyFactory.getSun();
final CelestialBody earth = CelestialBodyFactory.getEarth();
final Frame l2Frame = new L2Frame(sun, earth);
for (double dt = -Constants.JULIAN_DAY; dt <= Constants.JULIAN_DAY; dt += 3600.0) {
final AbsoluteDate date = date0.shiftedBy(dt);
final Vector3D sunPositionInL2 = sun.getPVCoordinates(date, l2Frame).getPosition();
final Vector3D earthPositionInL2 = earth.getPVCoordinates(date, l2Frame).getPosition();
Assert.assertEquals(0.0, Vector3D.angle(sunPositionInL2, Vector3D.MINUS_I), 3.0e-14);
Assert.assertEquals(0.0, Vector3D.angle(earthPositionInL2, Vector3D.MINUS_I), 3.0e-14);
}
}
use of org.orekit.bodies.CelestialBody in project Orekit by CS-SI.
the class L2TransformProviderTest method testSunJupiter.
@Test
public void testSunJupiter() throws OrekitException {
// Load Bodies
final CelestialBody sun = CelestialBodyFactory.getSun();
final CelestialBody jupiter = CelestialBodyFactory.getJupiter();
// Set frames
final Frame sunFrame = sun.getInertiallyOrientedFrame();
final Frame l2Frame = new L2Frame(sun, jupiter);
// Time settings
final AbsoluteDate date = new AbsoluteDate(2000, 01, 01, 0, 0, 00.000, TimeScalesFactory.getUTC());
// Compute Jupiter position in Sun centered frame
PVCoordinates pvJupiter = jupiter.getPVCoordinates(date, sunFrame);
Vector3D posJupiter = pvJupiter.getPosition();
// Compute L2 position in Sun centered frame
// (it is important to use transformPosition(Vector3D.ZERO) and *not* getTranslation()
// because the test should avoid doing wrong interpretation of the meaning and
// particularly on the sign of the translation)
Vector3D posL2 = l2Frame.getTransformTo(sunFrame, date).transformPosition(Vector3D.ZERO);
// check L2 and Jupiter are aligned as seen from Sun
Assert.assertEquals(0.0, Vector3D.angle(posJupiter, posL2), 1.0e-10);
// check L2 if at least 50 000 000km farther than Jupiter
Assert.assertTrue(posL2.getNorm() > posJupiter.getNorm() + 5.0e10);
}
use of org.orekit.bodies.CelestialBody in project Orekit by CS-SI.
the class L1TransformProviderTest method testTransformationOrientationForEarthMoon.
@Test
public void testTransformationOrientationForEarthMoon() throws OrekitException {
// Load Bodies
final CelestialBody earth = CelestialBodyFactory.getEarth();
final CelestialBody moon = CelestialBodyFactory.getMoon();
// Set framesd
final Frame eme2000 = FramesFactory.getEME2000();
final Frame l1Frame = new L1Frame(earth, moon);
// Time settings
final AbsoluteDate date = new AbsoluteDate(2000, 01, 01, 0, 0, 00.000, TimeScalesFactory.getUTC());
// Compute Moon position in EME2000
PVCoordinates pvMoon = moon.getPVCoordinates(date, eme2000);
Vector3D posMoon = pvMoon.getPosition();
// Compute L1 position in EME2000
// (it is important to use transformPosition(Vector3D.ZERO) and *not* getTranslation()
// because the test should avoid doing wrong interpretation of the meaning and
// particularly on the sign of the translation)
Vector3D posL1 = l1Frame.getTransformTo(eme2000, date).transformPosition(Vector3D.ZERO);
// check L1 and Moon are aligned as seen from Earth
Assert.assertEquals(0.0, Vector3D.angle(posMoon, posL1), 1.0e-10);
// check the Moon is at least 40 000km farther than L1
Assert.assertTrue(posMoon.getNorm() > posL1.getNorm() + 4.0e7);
}
use of org.orekit.bodies.CelestialBody in project Orekit by CS-SI.
the class L1TransformProviderTest method testSunJupiter.
@Test
public void testSunJupiter() throws OrekitException {
// Load Bodies
final CelestialBody sun = CelestialBodyFactory.getSun();
final CelestialBody jupiter = CelestialBodyFactory.getJupiter();
// Set frames
final Frame sunFrame = sun.getInertiallyOrientedFrame();
final Frame l1Frame = new L1Frame(sun, jupiter);
// Time settings
final AbsoluteDate date = new AbsoluteDate(2000, 01, 01, 0, 0, 00.000, TimeScalesFactory.getUTC());
// Compute Jupiter position in Sun centered frame
PVCoordinates pvJupiter = jupiter.getPVCoordinates(date, sunFrame);
Vector3D posJupiter = pvJupiter.getPosition();
// Compute L1 position in Sun centered frame
// (it is important to use transformPosition(Vector3D.ZERO) and *not* getTranslation()
// because the test should avoid doing wrong interpretation of the meaning and
// particularly on the sign of the translation)
Vector3D posL1 = l1Frame.getTransformTo(sunFrame, date).transformPosition(Vector3D.ZERO);
// check L1 and Jupiter are aligned as seen from Sun
Assert.assertEquals(0.0, Vector3D.angle(posJupiter, posL1), 1.0e-10);
// check if Jupiter is at least 45 000 000km farther than L1
Assert.assertTrue(posJupiter.getNorm() > posL1.getNorm() + 4.5e10);
}
Aggregations