OrbitAtTime extends Orbit { public OrbitAtTime afterTime(double dt) { double ma = getMeanAnomaly(); double n = getMeanAngularMotion(); double newMA = (ma + n * dt) % MathUtils.TWO_PI; double newEA = eccentricAnomalyFromMeanAnomaly(_e, newMA); double newTA = 2 * Math.atan2(Math.sqrt(1 + _e) * Math.sin(newEA / 2), Math.sqrt(1 - _e) * Math.cos(newEA / 2)); return new OrbitAtTime(_body, _a, _e, _i, _lan, _aop, newTA); } OrbitAtTime(Body body, double a, double e, double i, double lan, double aop, double ta);  OrbitAtTime(Orbit orbit, double ta);  OrbitAtTime(Body b, Vector3D rVec, Vector3D vVec);  OrbitAtTime(OrbitAtTime other); double getTrueAnomaly(); double getEccentricAnomaly(); double getMeanAnomaly(); Vector3D getRadiusVector(); Vector3D getVelocityVector(); double getRadius(); double getVelocity(); OrbitAtTime afterTime(double dt); double phaseAngleWith(OrbitAtTime oat);  }
@Test public void afterTime() { Body b = new Body("A", 1); double a = 1; double e = 0.5; double i = Math.PI / 4; double lan = Math.PI / 2; double aop = Math.PI; double ta = 3 * Math.PI / 2; OrbitAtTime oat = new OrbitAtTime(b, a, e, i, lan, aop, ta); OrbitAtTime oat2 = oat.afterTime(oat.getPeriod() / 2); assertEquals(b, oat2.getBody()); TestUtils.assertRelativelyEquals(a, oat2.getSMA(), 1e-9); TestUtils.assertRelativelyEquals(e, oat2.getEccentricity(), 1e-9); TestUtils.assertRelativelyEquals(i, oat2.getInclination(), 1e-9); TestUtils.assertRelativelyEquals(lan, oat2.getLAN(), 1e-9); TestUtils.assertRelativelyEquals(aop, oat2.getAOP(), 1e-9); TestUtils.assertRelativelyEquals(2.90066220105092, oat2.getTrueAnomaly(), 1e-9); }