/**
 * Calculates the approximate distance to a star using the stellar parallax method.
 * Stellar parallax is the apparent shift in a star's position due to the Earth's orbit around the Sun.
 *
 * @param distance The baseline distance from the Earth to the Sun (in astronomical units).
 * @param averageParallax The average measured parallax angle (in arcseconds).
 * @return The estimated distance to the star (in astronomical units).
 */
fun calculateStellarParallax(distance: Double, averageParallax: Double): Double {

    // Convert the average parallax angle from arcseconds to radians
    val parallaxRadians = averageParallax * 0.000004848

    // Calculate the estimated distance to the star using the formula: distance = 1 / (2 * sin(parallax_angle))
    val estimatedDistance = distance / (2 * Math.sin(parallaxRadians))

    return estimatedDistance
}
/**
 * Calculates the approximate distance to a star using the stellar parallax method.
 * Stellar parallax is the apparent shift in a star's position due to the Earth's orbit around the Sun.
 *
 * @param distance The baseline distance from the Earth to the Sun (in astronomical units).
 * @param averageParallax The average measured parallax angle (in arcseconds).
 * @return The estimated distance to the star (in astronomical units).
 */
fun calculateStellarParallax(distance: Double, averageParallax: Double): Double {
/**
 * Calculates the approximate distance to a star using the stellar parallax method.
 * Stellar parallax is the apparent shift in a star's position due to the Earth's orbit around the Sun.
 *
 * @param distance The baseline distance from the Earth to the Sun (in astronomical units).
 * @param averageParallax The average measured parallax angle (in arcseconds).
 * @return The estimated distance to the star (in astronomical units).
 */
fun calculateStellarParallax(distance: Double, averageParallax: Double): Double {

    // Convert the average parallax angle from arcseconds to radians
    val parallaxRadians = averageParallax * 0.000004848

    // Calculate the estimated distance to the star using the formula: distance = 1 / (2 * sin(parallax_angle))
    val estimatedDistance = distance / (2 * Math.sin(parallaxRadians))

    return estimatedDistance
}