sage: S.is_equivalent(expected_S)
True
"""
- # The lines() method only gives us one generator for each line,
- # so we negate the result and combine everything for the full set.
- S = Cone([p*l for p in [1,-1] for l in K.lines()], K.lattice())
+ # The lines() method only returns one generator per line. For a true
+ # line, we also need a generator pointing in the opposite direction.
+ S_gens = [ direction*gen for direction in [1,-1] for gen in K.lines() ]
+ S = Cone(S_gens, K.lattice())
# Since ``S`` is a subspace, the rays of its dual generate its
# orthogonal complement.
- P = K.intersection( Cone(S.dual(), K.lattice()) )
+ S_perp = Cone(S.dual(), K.lattice())
+ P = K.intersection(S_perp)
return (P,S)