def cal_weight(from_x, from_y, to_x, to_y):
    """
    calculate distance

    Args:
        from_x: x coordinate
        from_y: y coordinate
        to_x: x coordinate
        to_y: y coordinate

    Returns:
        distance
    """

    # return abs(from_x - to_x) + abs(from_y - to_y)  # manhattan
    return ((from_x - to_x) ** 2 + (from_y - to_y) ** 2) ** 0.5