/**
 * Given the coordinates (x1, y1) and (x2, y2), calculates the Manhattan distance between them.
 *
 * @param x1 The x-coordinate of the first point.
 * @param y1 The y-coordinate of the first point.
 * @param x2 The x-coordinate of the second point.
 * @param y2 The y-coordinate of the second point.
 * @return The Manhattan distance between the two points.
 */
fun calculateDistance(x1: Double, y1: Double, x2: Double, y2: Double): Double {

    val dx = Math.abs(x2 - x1)
    val dy = Math.abs(y2 - y1)
    val distance = dx + dy
    return distance
}
/**
 * Given the coordinates (x1, y1) and (x2, y2), calculates the Manhattan distance between them.
 *
 * @param x1 The x-coordinate of the first point.
 * @param y1 The y-coordinate of the first point.
 * @param x2 The x-coordinate of the second point.
 * @param y2 The y-coordinate of the second point.
 * @return The Manhattan distance between the two points.
 */
fun calculateDistance(x1: Double, y1: Double, x2: Double, y2: Double): Double {
/**
 * Given the coordinates (x1, y1) and (x2, y2), calculates the Manhattan distance between them.
 *
 * @param x1 The x-coordinate of the first point.
 * @param y1 The y-coordinate of the first point.
 * @param x2 The x-coordinate of the second point.
 * @param y2 The y-coordinate of the second point.
 * @return The Manhattan distance between the two points.
 */
fun calculateDistance(x1: Double, y1: Double, x2: Double, y2: Double): Double {

    val dx = Math.abs(x2 - x1)
    val dy = Math.abs(y2 - y1)
    val distance = dx + dy
    return distance
}