def is_between(e0, e1, f):
    """
    Check whether the vector ``f`` is strictly in the sector formed by the vectors
    ``e0`` and ``e1`` (in counter-clockwise order).

    TESTS::

        sage: from flatsurf.geometry.polygon import is_between
        sage: V = ZZ^2
        sage: vecs = [V((1,0)), V((2,1)), V((1,1)), V((1,2)),
        ....:  V((0,1)), V((-1,2)), V((-1,1)), V((-2,1)),
        ....:  V((-1,0)), V((-2,-1)), V((-1,-1)), V((-1,-2)),
        ....:  V((0,-1)), V((1,-2)), V((1,-1)), V((2,-1))]
        sage: for i in range(len(vecs)):
        ....:     for j in range(len(vecs)):
        ....:         if i == j: continue
        ....:         for k in range(len(vecs)):
        ....:             if k == i or k == j: continue
        ....:             ans = is_between(vecs[i], vecs[j], vecs[k])
        ....:             expected = i < k < j or k < j < i or j < i < k
        ....:             if ans != expected:
        ....:                 print((i,j,k),expected,ans)
    """
    if e0[0] * e1[1] > e1[0] * e0[1]:
        return e1[1] * f[0] > e1[0] * f[1] and e0[0] * f[1] > e0[1] * f[0]
    elif e0[0] * e1[1] == e1[0] * e0[1]:
        return e0[0] * f[1] > e0[1] * f[0]
    else:
        return e0[1] * f[0] <= e0[0] * f[1] or e1[0] * f[1] <= e1[1] * f[0]
