Computes wind-corrected per-leg timing for a parsed flight plan route.
Reuses computeRouteDistance for the leg geometry, then for each leg
derives the initial true course, samples the wind at the leg midpoint via the
optional WindProvider, and solves the wind triangle for heading, wind
correction angle, and ground speed. Estimated time enroute is leg distance
divided by ground speed, and fuel (when a burn rate is given) follows from
the same ground speed.
When the provider returns undefined for a leg, that leg is timed as calm:
heading equals course, wind correction angle is zero, and ground speed equals
true airspeed.
Ground speed comes from solveWindTriangle as a magnitude, so it is
never negative. A leg is left untimed (eteHrsundefined) only when ground
speed is not positive, which occurs at the boundary where a pure headwind
equals true airspeed. A headwind exceeding true airspeed still yields a
positive magnitude and inherits the clamping behavior documented on
solveWindTriangle; such legs are not separately flagged here. A single
untimed leg makes totalEteHrs (and totalFuelRequired, when fuel is
requested) undefined.
Computes wind-corrected per-leg timing for a parsed flight plan route.
Reuses computeRouteDistance for the leg geometry, then for each leg derives the initial true course, samples the wind at the leg midpoint via the optional WindProvider, and solves the wind triangle for heading, wind correction angle, and ground speed. Estimated time enroute is leg distance divided by ground speed, and fuel (when a burn rate is given) follows from the same ground speed.
When the provider returns
undefinedfor a leg, that leg is timed as calm: heading equals course, wind correction angle is zero, and ground speed equals true airspeed.Ground speed comes from solveWindTriangle as a magnitude, so it is never negative. A leg is left untimed (
eteHrsundefined) only when ground speed is not positive, which occurs at the boundary where a pure headwind equals true airspeed. A headwind exceeding true airspeed still yields a positive magnitude and inherits the clamping behavior documented on solveWindTriangle; such legs are not separately flagged here. A single untimed leg makestotalEteHrs(andtotalFuelRequired, when fuel is requested)undefined.