/**
 * This function takes two complex numbers as input and returns their division.
 *
 * @param a The first complex number in the form (realPart, imaginaryPart)
 * @param b The second complex number in the form (realPart, imaginaryPart)
 * @return The division of a/b in the form (realPart, imaginaryPart)
 */
fun complexDivision(a: Pair<Double, Double>, b: Pair<Double, Double>): Pair<Double, Double> {

    val (aReal, aImag) = a
    val (bReal, bImag) = b
    
    // Perform the division
    val divisionReal = (aReal * bReal + aImag * bImag) / (bReal * bReal + bImag * bImag)
    val divisionImag = (aImag * bReal - aReal * bImag) / (bReal * bReal + bImag * bImag)
    
    // Return the result
    return Pair(divisionReal, divisionImag)
}
/**
 * This function takes two complex numbers as input and returns their division.
 *
 * @param a The first complex number in the form (realPart, imaginaryPart)
 * @param b The second complex number in the form (realPart, imaginaryPart)
 * @return The division of a/b in the form (realPart, imaginaryPart)
 */
fun complexDivision(a: Pair<Double, Double>, b: Pair<Double, Double>): Pair<Double, Double> {
/**
 * This function takes two complex numbers as input and returns their division.
 *
 * @param a The first complex number in the form (realPart, imaginaryPart)
 * @param b The second complex number in the form (realPart, imaginaryPart)
 * @return The division of a/b in the form (realPart, imaginaryPart)
 */
fun complexDivision(a: Pair<Double, Double>, b: Pair<Double, Double>): Pair<Double, Double> {

    val (aReal, aImag) = a
    val (bReal, bImag) = b
    
    // Perform the division
    val divisionReal = (aReal * bReal + aImag * bImag) / (bReal * bReal + bImag * bImag)
    val divisionImag = (aImag * bReal - aReal * bImag) / (bReal * bReal + bImag * bImag)
    
    // Return the result
    return Pair(divisionReal, divisionImag)
}