import math


def distance(ref_point_1, ref_point_2):
    """
    Calculates straight line distance between two points (2d or 3d (tm))

    Args:
        ref_point_1 (tm): Reference point 1
        ref_point_2 (tm): Reference point 2

    Returns:
        float: distance between points 1 and 2

    """
    try:
        d = math.sqrt((ref_point_2[0] - ref_point_1[0])**2 + (ref_point_2[1] - ref_point_1[1])**2 + (ref_point_2[2] - ref_point_1[2])**2)
    except:
        d = math.sqrt((ref_point_2[0] - ref_point_1[0])**2 + (ref_point_2[1] - ref_point_1[1])**2)
    return d