void update_from_orbit(Orbit orb, double UT)
        {
            //calculate the position of a landing site
            if (orb.ApA <= TargetAltitude)
            {
                AtTargetUT = orb.StartUT + (orb.ApAhead()? orb.timeToAp : 1);
            }
            else if (orb.PeA < TargetAltitude)
            {
                AtTargetUT = TrajectoryCalculator.NearestRadiusUT(orb, Body.Radius + TargetAltitude, UT);
            }
            else
            {
                AtTargetUT = orb.StartUT + orb.timeToPe;
            }
            TransferTime = AtTargetUT - StartUT;
            AtTargetPos  = orb.getRelativePositionAtUT(AtTargetUT);
            AtTargetVel  = orb.getOrbitalVelocityAtUT(AtTargetUT);
            var at_target_rot = TrajectoryCalculator.BodyRotationAtdT(Body, -TimeToTarget);

            approach     = new Coordinates((at_target_rot * (AtTargetPos - AtTargetVel * 10)).xzy + Body.position, Body);
            SurfacePoint = new WayPoint((at_target_rot * AtTargetPos).xzy + Body.position, Body);
            SurfacePoint.Pos.SetAlt2Surface(Body);
            SurfacePoint.Name = "Landing Site";
        }
 void update_from_orbit(Orbit orb, double UT)
 {
     //calculate the position of a landing site
     if (orb.ApA <= TargetAltitude)
     {
         AtTargetUT = orb.StartUT + (orb.ApAhead()? orb.timeToAp : 1);
     }
     else
     {
         AtTargetUT = TrajectoryCalculator.NearestRadiusUT(orb, Body.Radius + TargetAltitude, UT);
     }
     TransferTime      = AtTargetUT - StartUT;
     AtTargetPos       = orb.getRelativePositionAtUT(AtTargetUT);
     AtTargetVel       = orb.getOrbitalVelocityAtUT(AtTargetUT);
     SurfacePoint      = new WayPoint((TrajectoryCalculator.BodyRotationAtdT(Body, -TimeToSurface) * AtTargetPos).xzy + Body.position, Body);
     SurfacePoint.Name = "Landing Site";
 }