import math


def calc_dist_interval(tmp_pos_list, cnt):
    """ Calculates the distance interval between pre and next positions. """

    distance_interval = math.sqrt(
        pow((tmp_pos_list[cnt+1][0] - tmp_pos_list[cnt][0]), 2) +
        pow((tmp_pos_list[cnt+1][1] - tmp_pos_list[cnt][1]), 2) +
        pow((tmp_pos_list[cnt+1][2] - tmp_pos_list[cnt][2]), 2))

    return distance_interval