/**
 * Given the temperatures (in degrees Celsius) at two different depths in a lake, calculate the temperature gradient.
 * The temperature gradient is the rate at which temperature changes with depth in the lake.
 *
 * @param temp1 Temperature at depth 1
 * @param temp2 Temperature at depth 2
 * @param depth1 Depth at temperature 1
 * @param depth2 Depth at temperature 2
 * @return Temperature gradient in degrees Celsius per meter
 *
 * Example:
 * calculateTemperatureGradient(10.0, 5.0, 5.0, 10.0) // -0.5
 * calculateTemperatureGradient(2.0, -4.0, 0.0, 20.0) // -0.3
 */
fun calculateTemperatureGradient(temp1: Double, temp2: Double, depth1: Double, depth2: Double): Double {

    val temperatureGradient = (temp2 - temp1) / (depth2 - depth1)
    return temperatureGradient
}
/**
 * Given the temperatures (in degrees Celsius) at two different depths in a lake, calculate the temperature gradient.
 * The temperature gradient is the rate at which temperature changes with depth in the lake.
 *
 * @param temp1 Temperature at depth 1
 * @param temp2 Temperature at depth 2
 * @param depth1 Depth at temperature 1
 * @param depth2 Depth at temperature 2
 * @return Temperature gradient in degrees Celsius per meter
 *
 * Example:
 * calculateTemperatureGradient(10.0, 5.0, 5.0, 10.0) // -0.5
 * calculateTemperatureGradient(2.0, -4.0, 0.0, 20.0) // -0.3
 */
fun calculateTemperatureGradient(temp1: Double, temp2: Double, depth1: Double, depth2: Double): Double {
/**
 * Given the temperatures (in degrees Celsius) at two different depths in a lake, calculate the temperature gradient.
 * The temperature gradient is the rate at which temperature changes with depth in the lake.
 *
 * @param temp1 Temperature at depth 1
 * @param temp2 Temperature at depth 2
 * @param depth1 Depth at temperature 1
 * @param depth2 Depth at temperature 2
 * @return Temperature gradient in degrees Celsius per meter
 *
 * Example:
 * calculateTemperatureGradient(10.0, 5.0, 5.0, 10.0) // -0.5
 * calculateTemperatureGradient(2.0, -4.0, 0.0, 20.0) // -0.3
 */
fun calculateTemperatureGradient(temp1: Double, temp2: Double, depth1: Double, depth2: Double): Double {

    val temperatureGradient = (temp2 - temp1) / (depth2 - depth1)
    return temperatureGradient
}