Пример #1
0
def taut_rays(tri, angle):
    # get the extreme rays of the taut cone - note that the returned
    # vectors are non-negative because they "point up"
    N = edge_equation_matrix_taut(tri, angle)
    N = Matrix(N)
    dim = N.dimensions()[1]
    elem_ieqs = [[0] + list(elem_vector(i, dim)) for i in range(dim)]
    N_rows = [v.list() for v in N.rows()]
    N_eqns = [[0] + v for v in N_rows]
    P = Polyhedron(ieqs = elem_ieqs, eqns = N_eqns)

    rays = [ray.vector() for ray in P.rays()]
    for ray in rays:
        assert all(a.is_integer() for a in ray)
    # all of the entries are integers, represented in QQ, so we clean them.
    return [vector(ZZ(a) for a in ray) for ray in rays]