/**
 * Given the declination and right ascension angles of an astronomer's coordinates,
 * create a tuple with the rounded values.
 *
 * @param declinationAngle The declination angle in degrees.
 * @param rightAscensionAngle The right ascension angle in degrees.
 * @return A tuple containing the rounded declination and right ascension angles.
 */
fun createAstronomerCoordinatesTuple(declinationAngle: Double, rightAscensionAngle: Double): Pair<Double, Double> {

    // Round the declination and right ascension angles to 4 decimal places
    val roundedDeclination = declinationAngle.round(4)
    val roundedRightAscension = rightAscensionAngle.round(4)

    // Create a Pair with the rounded values
    return Pair(roundedDeclination, roundedRightAscension)
}

// Extension function to round a Double value to a specific number of decimal places
fun Double.round(decimals: Int): Double = "%.${decimals}f".format(this).toDouble()

// Example usage
/**
 * Given the declination and right ascension angles of an astronomer's coordinates,
 * create a tuple with the rounded values.
 *
 * @param declinationAngle The declination angle in degrees.
 * @param rightAscensionAngle The right ascension angle in degrees.
 * @return A tuple containing the rounded declination and right ascension angles.
 */
fun createAstronomerCoordinatesTuple(declinationAngle: Double, rightAscensionAngle: Double): Pair<Double, Double> {
/**
 * Given the declination and right ascension angles of an astronomer's coordinates,
 * create a tuple with the rounded values.
 *
 * @param declinationAngle The declination angle in degrees.
 * @param rightAscensionAngle The right ascension angle in degrees.
 * @return A tuple containing the rounded declination and right ascension angles.
 */
fun createAstronomerCoordinatesTuple(declinationAngle: Double, rightAscensionAngle: Double): Pair<Double, Double> {

    // Round the declination and right ascension angles to 4 decimal places
    val roundedDeclination = declinationAngle.round(4)
    val roundedRightAscension = rightAscensionAngle.round(4)

    // Create a Pair with the rounded values
    return Pair(roundedDeclination, roundedRightAscension)
}

// Extension function to round a Double value to a specific number of decimal places
fun Double.round(decimals: Int): Double = "%.${decimals}f".format(this).toDouble()

// Example usage