import math


def _measure(lon1, lat1, lon2, lat2):
    """
        Getting distance between two nodes (in meters)

        Arguments:
            :param lon1: float
            :param lat1: float
                * Coordinates of first node
            :param lon2: float
            :param lat2: float
                * Coordinates of second node

        Return:
            :param d: float
    """
    R = 6378.137  # Radius of earth in KM
    dLat = lat2 * math.pi / 180 - lat1 * math.pi / 180
    dLon = lon2 * math.pi / 180 - lon1 * math.pi / 180
    a = math.sin(dLat / 2) * math.sin(dLat / 2) + \
        math.cos(lat1 * math.pi / 180) * math.cos(lat2 * math.pi / 180) * \
        math.sin(dLon / 2) * math.sin(dLon / 2)
    c = 2 * math.atan2(math.sqrt(a), math.sqrt(1 - a))
    d = R * c
    return d * 1000