def distance_from_mag(m, M, A):
    """
    Compute distance from magnitudes.

    Parameters
    ----------
    m : float
        Apparent magnitude
    M : float
        Absolute magnitude
    A : float
        Absorption

    Returns
    -------
    d : float
        distance in parsec
    """
    return 10 ** (1 + (m - M - A) / 5.0)