/**
 * The function finds the common magnitudes between two arrays of complex numbers in polar representation.
 *
 * @param array1 A list of complex numbers in polar representation
 * @param array2 Another list of complex numbers in polar representation
 * @return A list of common magnitudes between the two arrays.
 */
fun findCommonMagnitude(array1: List<Pair<Double, Double>>, array2: List<Pair<Double, Double>>): List<Double> {

    val magnitudes1 = array1.map { it.first }
    val magnitudes2 = array2.map { it.first }
    val commonMagnitudes = magnitudes1.intersect(magnitudes2).toList()
    return commonMagnitudes
}
/**
 * The function finds the common magnitudes between two arrays of complex numbers in polar representation.
 *
 * @param array1 A list of complex numbers in polar representation
 * @param array2 Another list of complex numbers in polar representation
 * @return A list of common magnitudes between the two arrays.
 */
fun findCommonMagnitude(array1: List<Pair<Double, Double>>, array2: List<Pair<Double, Double>>): List<Double> {
/**
 * The function finds the common magnitudes between two arrays of complex numbers in polar representation.
 *
 * @param array1 A list of complex numbers in polar representation
 * @param array2 Another list of complex numbers in polar representation
 * @return A list of common magnitudes between the two arrays.
 */
fun findCommonMagnitude(array1: List<Pair<Double, Double>>, array2: List<Pair<Double, Double>>): List<Double> {

    val magnitudes1 = array1.map { it.first }
    val magnitudes2 = array2.map { it.first }
    val commonMagnitudes = magnitudes1.intersect(magnitudes2).toList()
    return commonMagnitudes
}