On Wed, Feb 27, 2019 at 1:02 PM Daniel Krenn <kr...@aon.at> wrote:
>
> Say we have
>
> sage: P = polytopes.simplex(2)
> sage: P.faces(1)
> (<0,1>, <0,2>, <1,2>)
>
> Is there an easy way in SageMath to compute the in- or outward surface
> normal vector of these faces of P? (in contrast to doing it all from
> scratch). If not, are there methods that might help, so that not
> everything needs to be built from scratch?
>
> Note: What I search for, is a method that works for a general compact
> polyghedron in any dimension and their faces of dimension-1.


In the full-dimensional case, say, P=polytopes.cube()
P.inequalities() is more or less what you need (as they correspond to
the facets,
a.k.a. faces of codimension 1)
e.g. P.inequalities()[0].vector()[1:]
(0, 0, -1)
is one of the 6 normal vectors.

I suppose in non-full-dimensional case you still can use
P.inequalities() as above,
projecting them on the affine hull of P.

Dima





>
> Best
>
> Daniel
>
> --
> You received this message because you are subscribed to the Google Groups 
> "sage-support" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to sage-support+unsubscr...@googlegroups.com.
> To post to this group, send email to sage-support@googlegroups.com.
> Visit this group at https://groups.google.com/group/sage-support.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.

Reply via email to