/**
 * Calculates the area of intersection between two circles given their radii.
 *
 * @param radius1 The radius of the first circle
 * @param radius2 The radius of the second circle
 * @return The area of intersection between the two circles
 */
fun intersectionArea(radius1: Double, radius2: Double): Double {

    // Calculate the distance between the centers of the two circles
    val distance = Math.abs(radius1 - radius2)

    // Condition 1: If the distance is greater than or equal to the sum of the radii, no intersection
    if (distance >= radius1 + radius2) {
        return 0.0
    }

    // Condition 2: If one circle is completely within the other, intersection area is smaller circle's area
    val smallerRadius = if (radius1 < radius2) radius1 else radius2
    val largerRadius = if (radius1 < radius2) radius2 else radius1

    if (smallerRadius + distance <= largerRadius) {
        return 3.14159 * smallerRadius * smallerRadius
    }

    // Condition 3: General case, where circles intersect
    // Add your implementation for this condition here

    return 0.0
}
/**
 * Calculates the area of intersection between two circles given their radii.
 *
 * @param radius1 The radius of the first circle
 * @param radius2 The radius of the second circle
 * @return The area of intersection between the two circles
 */
fun intersectionArea(radius1: Double, radius2: Double): Double {
/**
 * Calculates the area of intersection between two circles given their radii.
 *
 * @param radius1 The radius of the first circle
 * @param radius2 The radius of the second circle
 * @return The area of intersection between the two circles
 */
fun intersectionArea(radius1: Double, radius2: Double): Double {

    // Calculate the distance between the centers of the two circles
    val distance = Math.abs(radius1 - radius2)

    // Condition 1: If the distance is greater than or equal to the sum of the radii, no intersection
    if (distance >= radius1 + radius2) {
        return 0.0
    }

    // Condition 2: If one circle is completely within the other, intersection area is smaller circle's area
    val smallerRadius = if (radius1 < radius2) radius1 else radius2
    val largerRadius = if (radius1 < radius2) radius2 else radius1

    if (smallerRadius + distance <= largerRadius) {
        return 3.14159 * smallerRadius * smallerRadius
    }

    // Condition 3: General case, where circles intersect
    // Add your implementation for this condition here

    return 0.0
}