def reflectance(n1, n2):
    """Calculate the amplitude reflection coefficient due to moving from media with index n1 to media with index n2.

    Args:
        n1 (float:): Refractive index of media 1.
        n2 (float:): Refractive index of media 2.

    Returns:
        float: Reflection coefficient"""
    return (n1 - n2) / (n1 + n2)