toTAS method

double toTAS(
  1. Atmo atAtmoPoint
)

Convert the speed to True Airspeed at a defined Atmo point atAtmoPoint. The converted speed unit is the same as the input speed unit.

Implementation

double toTAS(Atmo atAtmoPoint) {
  double resultInKnots;
  switch (type) {
    case SpeedType.cas:
      resultInKnots = speedKCASToKTAS(_speedInKnots,
          atAtmoPoint.getHpInFeet(), _getDeltaISAInCelsius(atAtmoPoint));
      break;
    case SpeedType.eas:
      resultInKnots = speedKEASToKTAS(_speedInKnots,
          atAtmoPoint.getHpInFeet(), _getDeltaISAInCelsius(atAtmoPoint));
      break;
    case SpeedType.tas:
      return value;
    case SpeedType.mach:
      resultInKnots = speedMachToKTAS(value, atAtmoPoint.getHpInFeet(),
          _getDeltaISAInCelsius(atAtmoPoint));
      break;
  }

  // Return output speed in same unit as input speed was provided.
  return _convertSpeedResultToInputUnit(resultInKnots, unitSpeed);
}