def _length_squared(v0, v1):
    """
    The square of the distance between points v0 and v1.
    Params: v0, and v1 are points expressed as [x, y].
    """
    dx = v1[0]-v0[0]
    dy = v1[1]-v0[1]
    return dx*dx + dy*dy