@Test public void testMiss() throws OrekitException { final CircularOrbit circ = new CircularOrbit( 7178000.0, 0.5e-4, -0.5e-4, FastMath.toRadians(0.), FastMath.toRadians(270.), FastMath.toRadians(5.300), PositionAngle.MEAN, FramesFactory.getEME2000(), date, mu); final LofOffset upsideDown = new LofOffset(circ.getFrame(), LOFType.VVLH, RotationOrder.XYX, FastMath.PI, 0, 0); final LofOffsetPointing pointing = new LofOffsetPointing(earthSpheric, upsideDown, Vector3D.PLUS_K); try { pointing.getTargetPV(circ, date, circ.getFrame()); Assert.fail("an exception should have been thrown"); } catch (OrekitException oe) { Assert.assertEquals( OrekitMessages.ATTITUDE_POINTING_LAW_DOES_NOT_POINT_TO_GROUND, oe.getSpecifier()); } }
/** Test if both constructors are equivalent */ @Test public void testLof() throws OrekitException { // Satellite position final CircularOrbit circ = new CircularOrbit( 7178000.0, 0.5e-4, -0.5e-4, FastMath.toRadians(0.), FastMath.toRadians(270.), FastMath.toRadians(5.300), PositionAngle.MEAN, FramesFactory.getEME2000(), date, mu); // Create lof aligned law // ************************ final LofOffset lofLaw = new LofOffset(circ.getFrame(), LOFType.VVLH); final LofOffsetPointing lofPointing = new LofOffsetPointing(earthSpheric, lofLaw, Vector3D.PLUS_K); final Rotation lofRot = lofPointing.getAttitude(circ, date, circ.getFrame()).getRotation(); // Compare to body center pointing law // ************************************* final BodyCenterPointing centerLaw = new BodyCenterPointing(earthSpheric.getBodyFrame()); final Rotation centerRot = centerLaw.getAttitude(circ, date, circ.getFrame()).getRotation(); final double angleBodyCenter = centerRot.applyInverseTo(lofRot).getAngle(); Assert.assertEquals(0., angleBodyCenter, Utils.epsilonAngle); // Compare to nadir pointing law // ******************************* final NadirPointing nadirLaw = new NadirPointing(earthSpheric); final Rotation nadirRot = nadirLaw.getAttitude(circ, date, circ.getFrame()).getRotation(); final double angleNadir = nadirRot.applyInverseTo(lofRot).getAngle(); Assert.assertEquals(0., angleNadir, Utils.epsilonAngle); }