How do I do the Minkowski sum of two sets?

I have 2 sets, $X$ and $Y$. How do I find the Minkowski sum of these sets?

• according to wikipedia: Join @@ Outer[Plus, X, Y, 1]? Not sure if one should Union at the end, is this what you need?
– Kuba
Mar 4 '15 at 21:06
• Welcome to Mathematica.SE! I suggest that: 1) You take the introductory Tour now! 2) When you see good questions and answers, vote them up by clicking the gray triangles, because the credibility of the system is based on the reputation gained by users sharing their knowledge. Also, please remember to accept the answer, if any, that solves your problem, by clicking the checkmark sign! 3) As you receive help, try to give it too, by answering questions in your area of expertise. Mar 4 '15 at 21:10

Another way is with Tuples and Total.

A = {1, 2, 3};
B = {a, b, c};

MinkowskiSum[lis__] := Total[Tuples[{lis}], {2}]

MinkowskiSum[A, B]
{a+1, b+1, c+1, a+2, b+2, c+2, a+3, b+3, c+3}
A1 = {1, 2};
A2 = {a, b};
A3 = {x, y};

MinkowskiSum[A1, A2, A3]
{a+x+1, a+y+1, b+x+1, b+y+1, a+x+2, a+y+2, b+x+2, b+y+2}

For example

x = {{1, 0}, {0, 1}, {0, -1}};
y = {{0, 0}, {1, 1}, {1, -1}};

Union @@ Outer[Plus, x, y, 1]
{{0, -1}, {0, 1}, {1, -2}, {1, 0}, {1, 2}, {2, -1}, {2, 1}}

You can use CirclePlus (⊕) (entered as \[CirclePlus] or Escc+Esc) to define your Minkowski sum:

CirclePlus[x__] := Flatten[Union @@ Outer[Plus, x, 1], Length@{x} - 2]

x⊕y
{{0, -1}, {0, 1}, {1, -2}, {1, 0}, {1, 2}, {2, -1}, {2, 1}}
{{1,2}}⊕{{a,b}}⊕{{c,d}}
{{1 + a + c, 2 + b + d}}
• How come it doesn't work with this problem? :( projecteuler.net/problem=228 I made two sets: s={{1/2, Sqrt/2}, {-1, 0}, {1/2, -(Sqrt/2)}}; s={{1/Sqrt, 1/Sqrt}, {-(1/Sqrt), 1/Sqrt}, {-(1/Sqrt), -(1/Sqrt)}, {1/Sqrt, -(1/Sqrt)}} But when I did Graphics[{Green, Polygon[s[CirclePlus]s]}], I got something super crazy. Though now that I look at the overall shape, I feel like the outermost 6 points could result in the same shape as in the problem, but for some reason it's filled in a really strange way. Mar 30 '15 at 19:26
• @Solarmew Use Point instead of Polygon to see that it does work and use Line to see why your Polygon doesn't have the expected shape. Mar 30 '15 at 19:53
• I see. That's what I suspected. Is there a way to actually get the needed filled shape? Though even at that point, I'm not entirely sure how I'm gonna extract the number of sides from it %\ ... Mar 30 '15 at 20:34
• @Solarmew you might be looking for ConvexHullMesh and Region Properties and Measures. Mar 30 '15 at 20:36