Speed constructor

Speed({
  1. required double value,
  2. required SpeedType type,
  3. SpeedUnit unitSpeed = SpeedUnit.kts,
})

Speed class

Defines a speed value and type, where type is one of four options: Equivalent (EAS), Calibrated (CAS), True (TAS) airspeeds, or Mach.

The default speed input unit it knots, but other units such as ft/s, m/s, mph or km/h can be set using unitSpeed. A Mach input ignores the unit setting.

NOTE: When converting a Speed condition to other speeds using the Speed class methods, the output speed unit (if not a Mach output) is the same unit at the input speed is defined in. If a Mach input is set and no unitSpeed is defined, output speeds are in knots.

Implementation

Speed(
    {required this.value,
    required this.type,
    this.unitSpeed = SpeedUnit.kts}) {
  // Ensure speed input is in knots, as knots is the internally used unit
  _speedInKnots = _convertSpeedToKnots(value, unitSpeed);
}