/**
 * Convert polar coordinates to cartesian coordinates.
 *
 * @param theta The angle in radians.
 * @param r The distance from the origin.
 * @return The (x, y) cartesian coordinates as a Pair.
 */
fun polarToCartesian(theta: Double, r: Double): Pair<Double, Double> {

    val x = r * Math.cos(theta)
    val y = r * Math.sin(theta)
    return Pair(x, y)
}
/**
 * Convert polar coordinates to cartesian coordinates.
 *
 * @param theta The angle in radians.
 * @param r The distance from the origin.
 * @return The (x, y) cartesian coordinates as a Pair.
 */
fun polarToCartesian(theta: Double, r: Double): Pair<Double, Double> {
/**
 * Convert polar coordinates to cartesian coordinates.
 *
 * @param theta The angle in radians.
 * @param r The distance from the origin.
 * @return The (x, y) cartesian coordinates as a Pair.
 */
fun polarToCartesian(theta: Double, r: Double): Pair<Double, Double> {

    val x = r * Math.cos(theta)
    val y = r * Math.sin(theta)
    return Pair(x, y)
}