import math


def compute_air_distance(_src, _dst):
    """Compute Air Distance

    based on latitude and longitude
    input: a pair of (lat, lon)s
    output: air distance as km
    """
    distance = 0.0

    if _src == _dst:
        return distance

    radius = 6371.0  # km

    dlat = math.radians(_dst[0] - _src[0])
    dlon = math.radians(_dst[1] - _src[1])
    a = math.sin(dlat / 2.0) * math.sin(dlat / 2.0) + \
        math.cos(math.radians(_src[0])) * \
        math.cos(math.radians(_dst[0])) * \
        math.sin(dlon / 2.0) * math.sin(dlon / 2.0)
    c = 2.0 * math.atan2(math.sqrt(a), math.sqrt(1.0 - a))
    distance = radius * c

    return distance