import six
import math


def _midline_length(points):
    """
    Calculates the length of a path connecting *points*.
    """
    dist = 0
    ipoints = iter(points)
    a = six.next(ipoints) # prime loop
    for b in ipoints:
        dist += math.sqrt((a[0] - b[0])**2 + (a[1] - b[1])**2)
        a = b
    return dist