/**
 * Convert a complex number from polar form to cartesian form.
 *
 * @param polarNumber A tuple representing a complex number in polar form. The tuple should contain the
 *                    magnitude and angle of the complex number.
 * @return A tuple representing the same complex number in cartesian form. The tuple contains the real part and
 *         imaginary part of the complex number.
 */
import kotlin.math.cos
import kotlin.math.sin


fun convertPolarToCartesian(polarNumber: Pair<Double, Double>): Pair<Double, Double> {

    val (magnitude, angle) = polarNumber
    val realPart = magnitude * cos(angle)
    val imaginaryPart = magnitude * sin(angle)
    return Pair(realPart, imaginaryPart)
}
import kotlin.math.cos
import kotlin.math.sin

/**
 * Convert a complex number from polar form to cartesian form.
 *
 * @param polarNumber A tuple representing a complex number in polar form. The tuple should contain the
 *                    magnitude and angle of the complex number.
 * @return A tuple representing the same complex number in cartesian form. The tuple contains the real part and
 *         imaginary part of the complex number.
 */
fun convertPolarToCartesian(polarNumber: Pair<Double, Double>): Pair<Double, Double> {
import kotlin.math.cos
import kotlin.math.sin

/**
 * Convert a complex number from polar form to cartesian form.
 *
 * @param polarNumber A tuple representing a complex number in polar form. The tuple should contain the
 *                    magnitude and angle of the complex number.
 * @return A tuple representing the same complex number in cartesian form. The tuple contains the real part and
 *         imaginary part of the complex number.
 */
fun convertPolarToCartesian(polarNumber: Pair<Double, Double>): Pair<Double, Double> {

    val (magnitude, angle) = polarNumber
    val realPart = magnitude * cos(angle)
    val imaginaryPart = magnitude * sin(angle)
    return Pair(realPart, imaginaryPart)
}