/**
 * Given the coordinates of two points (x1, y1) and (x2, y2), calculate and return the Euclidean distance between them.
 *
 * @param x1 x-coordinate of point 1
 * @param y1 y-coordinate of point 1
 * @param x2 x-coordinate of point 2
 * @param y2 y-coordinate of point 2
 * @return Euclidean distance between the two points
 */
fun calculateDistance(x1: Double, y1: Double, x2: Double, y2: Double): Double {

    // Calculate the difference in coordinates
    val xDiff = Math.abs(x2 - x1)
    val yDiff = Math.abs(y2 - y1)

    // Calculate the sum of squares of the differences
    val sumSquares = Math.pow(xDiff, 2.0) + Math.pow(yDiff, 2.0)

    // Calculate the square root of the sum of squares
    val distance = Math.pow(sumSquares, 0.5)

    return distance
}
/**
 * Given the coordinates of two points (x1, y1) and (x2, y2), calculate and return the Euclidean distance between them.
 *
 * @param x1 x-coordinate of point 1
 * @param y1 y-coordinate of point 1
 * @param x2 x-coordinate of point 2
 * @param y2 y-coordinate of point 2
 * @return Euclidean distance between the two points
 */
fun calculateDistance(x1: Double, y1: Double, x2: Double, y2: Double): Double {
/**
 * Given the coordinates of two points (x1, y1) and (x2, y2), calculate and return the Euclidean distance between them.
 *
 * @param x1 x-coordinate of point 1
 * @param y1 y-coordinate of point 1
 * @param x2 x-coordinate of point 2
 * @param y2 y-coordinate of point 2
 * @return Euclidean distance between the two points
 */
fun calculateDistance(x1: Double, y1: Double, x2: Double, y2: Double): Double {

    // Calculate the difference in coordinates
    val xDiff = Math.abs(x2 - x1)
    val yDiff = Math.abs(y2 - y1)

    // Calculate the sum of squares of the differences
    val sumSquares = Math.pow(xDiff, 2.0) + Math.pow(yDiff, 2.0)

    // Calculate the square root of the sum of squares
    val distance = Math.pow(sumSquares, 0.5)

    return distance
}