toCAS method
Convert the speed to Calibrated Airspeed at a defined Atmo point
atAtmoPoint
. The converted speed unit is the same as the input
speed unit.
Implementation
double toCAS(Atmo atAtmoPoint) {
double resultInKnots;
switch (type) {
case SpeedType.cas:
return value;
case SpeedType.eas:
resultInKnots =
speedKEASToKCAS(_speedInKnots, atAtmoPoint.getHpInFeet());
break;
case SpeedType.tas:
resultInKnots = speedKTASToKCAS(_speedInKnots,
atAtmoPoint.getHpInFeet(), _getDeltaISAInCelsius(atAtmoPoint));
break;
case SpeedType.mach:
resultInKnots = speedMachToKCAS(value, atAtmoPoint.getHpInFeet());
break;
}
// Return output speed in same unit as input speed was provided
return _convertSpeedResultToInputUnit(resultInKnots, unitSpeed);
}