/**
 * Calculate the Mach number using the given formula:
 * Mach_number = sqrt(((total_pressure / static_pressure).pow((gamma - 1) / gamma)) - 1)
 *
 * @param totalPressure Total pressure of the fluid
 * @param staticPressure Static pressure of the fluid
 * @param gamma Specific heat ratio
 * @return Calculated Mach number
 * @throws IllegalArgumentException If totalPressure or staticPressure is less than or equal to 0
 */
import kotlin.math.pow
import kotlin.math.sqrt


fun calculateMachNumber(totalPressure: Double, staticPressure: Double, gamma: Double): Double {

    if (totalPressure <= 0 || staticPressure <= 0) {
        throw IllegalArgumentException("Pressure values must be greater than 0")
    }

    return sqrt(((totalPressure / staticPressure).pow((gamma - 1) / gamma)) - 1)
}
import kotlin.math.pow
import kotlin.math.sqrt

/**
 * Calculate the Mach number using the given formula:
 * Mach_number = sqrt(((total_pressure / static_pressure).pow((gamma - 1) / gamma)) - 1)
 *
 * @param totalPressure Total pressure of the fluid
 * @param staticPressure Static pressure of the fluid
 * @param gamma Specific heat ratio
 * @return Calculated Mach number
 * @throws IllegalArgumentException If totalPressure or staticPressure is less than or equal to 0
 */
fun calculateMachNumber(totalPressure: Double, staticPressure: Double, gamma: Double): Double {
import kotlin.math.pow
import kotlin.math.sqrt

/**
 * Calculate the Mach number using the given formula:
 * Mach_number = sqrt(((total_pressure / static_pressure).pow((gamma - 1) / gamma)) - 1)
 *
 * @param totalPressure Total pressure of the fluid
 * @param staticPressure Static pressure of the fluid
 * @param gamma Specific heat ratio
 * @return Calculated Mach number
 * @throws IllegalArgumentException If totalPressure or staticPressure is less than or equal to 0
 */
fun calculateMachNumber(totalPressure: Double, staticPressure: Double, gamma: Double): Double {

    if (totalPressure <= 0 || staticPressure <= 0) {
        throw IllegalArgumentException("Pressure values must be greater than 0")
    }

    return sqrt(((totalPressure / staticPressure).pow((gamma - 1) / gamma)) - 1)
}