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

# minkowskiSum -- computes the Minkowski sum of two convex objects

- Usage:
    `Q = minkowskiSum(X,Y)`
- Inputs:
  - X, Cone or Polyhedron
  - Y, Cone or Polyhedron
- Outputs:
  - Q, Cone or Polyhedron

## Description

The Minkowski sum of X and Y is the polyhedron X + Y = {x + y | x in X, y in Y}. If X and Y are both cones, then their Minkowski sum is their positive hull, which is a cone, so the output is a Cone. Otherwise the output is a Polyhedron. X and Y have to lie in the same ambient space.

    i1 : P1 = convexHull matrix {{0,1,-1},{0,-1,-1}}

    o1 = P1

    o1 : Polyhedron

    i2 : P2 = convexHull matrix {{0,1,-1},{0,1,1}}

    o2 = P2

    o2 : Polyhedron

    i3 : Q = minkowskiSum(P1,P2)

    o3 = Q

    o3 : Polyhedron

    i4 : vertices Q

    o4 = | -2 2 -1 1  -1 1 |
         | 0  0 -1 -1 1  1 |

                  2       6
    o4 : Matrix QQ  <-- QQ

See also Cone + Cone, Cone + Polyhedron, Polyhedron + Cone, and Polyhedron + Cone.

## Ways to use minkowskiSum:

- `minkowskiSum(Cone,Cone)`
- `minkowskiSum(Cone,Polyhedron)`
- `minkowskiSum(Polyhedron,Cone)`
- `minkowskiSum(Polyhedron,Polyhedron)`

## For the programmer

The object minkowskiSum is a method function.

The source of this document is in /build/macaulay2-88fgJW/macaulay2-1.25.11+ds/M2/Macaulay2/packages/Polyhedra/documentation/old_documentation.m2:2715:0.