/**
 * This function calculates the airspeed using the given pressure and temperature values.
 * The airspeed is computed using the following formula:
 *
 * airspeed = temperature * sqrt(2 * pressure)
 *
 * @param pressure The atmospheric pressure in pascals (Pa)
 * @param temperature The ambient temperature in Kelvin (K)
 * @return The calculated airspeed or null if either pressure or temperature is negative
 */
fun calculateAirspeed(pressure: Double, temperature: Double): Double? {

    val airspeed: Double?

    if (pressure >= 0 && temperature >= 0) {
        airspeed = temperature * Math.sqrt(2 * pressure)
    } else {
        airspeed = null
    }

    return airspeed
}
/**
 * This function calculates the airspeed using the given pressure and temperature values.
 * The airspeed is computed using the following formula:
 *
 * airspeed = temperature * sqrt(2 * pressure)
 *
 * @param pressure The atmospheric pressure in pascals (Pa)
 * @param temperature The ambient temperature in Kelvin (K)
 * @return The calculated airspeed or null if either pressure or temperature is negative
 */
fun calculateAirspeed(pressure: Double, temperature: Double): Double? {
/**
 * This function calculates the airspeed using the given pressure and temperature values.
 * The airspeed is computed using the following formula:
 *
 * airspeed = temperature * sqrt(2 * pressure)
 *
 * @param pressure The atmospheric pressure in pascals (Pa)
 * @param temperature The ambient temperature in Kelvin (K)
 * @return The calculated airspeed or null if either pressure or temperature is negative
 */
fun calculateAirspeed(pressure: Double, temperature: Double): Double? {

    val airspeed: Double?

    if (pressure >= 0 && temperature >= 0) {
        airspeed = temperature * Math.sqrt(2 * pressure)
    } else {
        airspeed = null
    }

    return airspeed
}