Macaulay2 » Documentation
Packages » Polyhedra :: centroid
next | previous | forward | backward | up | index | toc

centroid -- computes the centroid or barycenter of a polyhedron

Description

The centroid of a polyhedron is the center of mass of the polyhedron. This is computed by first triangulating the polyhedron, and then taking a weighted sum of the barycenters of the simplices in the triangulation.

i1 : centroid stdSimplex 3

o1 = | 1/4 |
     | 1/4 |
     | 1/4 |
     | 1/4 |

              4       1
o1 : Matrix QQ  <-- QQ
i2 : centroid hypercube 2

o2 = 0

              2       1
o2 : Matrix QQ  <-- QQ

See also

Ways to use centroid:

  • centroid(Polyhedron)

For the programmer

The object centroid is a method function.


The source of this document is in /build/reproducible-path/macaulay2-1.26.05+ds/M2/Macaulay2/packages/Polyhedra/documentation/documentation.m2:131:0.