diff --git a/src/sage/geometry/polyhedron/base.py b/src/sage/geometry/polyhedron/base.py index 022d31fb314..aca0c7bed18 100644 --- a/src/sage/geometry/polyhedron/base.py +++ b/src/sage/geometry/polyhedron/base.py @@ -2804,6 +2804,30 @@ def normal_fan(self, direction='inner'): ... NotImplementedError: normal fan handles only polytopes over the rationals + sage: P = Polyhedron(vertices=[[0,0],[2,0],[0,2],[2,1],[1,2]]) + sage: P.normal_fan(direction=None) + Traceback (most recent call last): + ... + TypeError: the direction should be `inner` or `outer` + + sage: inner_nf = P.normal_fan() + sage: inner_nf.rays() + N( 1, 0), + N( 0, -1), + N( 0, 1), + N(-1, 0), + N(-1, -1) + in 2-d lattice N + + sage: outer_nf = P.normal_fan(direction='outer') + sage: outer_nf.rays() + N( 1, 0), + N( 1, 1), + N( 0, 1), + N(-1, 0), + N( 0, -1) + in 2-d lattice N + REFERENCES: For more information, see Chapter 7 of [Zie2007]_.