import math


def _edge_lengths(points):
    """ Compute edge lengths from ordered points
    Assumes points are in order.

    Returns
    -------
    list[float, ..]

    """

    if len(points) != 4:
        raise ValueError('Expected 4 points instead of {}'.format(len(points)))

    lengths = []

    for i in range(-2, 3):
        dx = abs(points[i][0] - points[i + 1][0])
        dy = abs(points[i][1] - points[i + 1][1])
        length = math.sqrt(dx ** 2 + dy ** 2)
        lengths.append(length)

    return lengths