minkowskiSum
Version 1.0.0 (2,1 KB) von
John D'Errico
Compute the Minkowski sum of any two polygons or polyshapes, convex or concave.
The Minkowski sum of two polygons
is simply computed for two convex polygons, but if they may be more general with concavities, the sum is slightly more complex. minkowskiSum will work for any pair of polygons (even self-intersecting polygons), returning a polyshape as a result.
Pa = polyshape([-1 2;0 2;-0.75 2.25;-1 3]);
Pb = polyshape([1 0;2 0;3 1;4 3;2 .3]);
plot(Pa)
hold on
plot(Pb)
MSumShape = minkowskiSum(Pa,Pb)
MSumShape =
polyshape with properties:
Vertices: [8×2 double]
NumRegions: 1
NumHoles: 0
Zitieren als
John D'Errico (2024). minkowskiSum (https://www.mathworks.com/matlabcentral/fileexchange/121478-minkowskisum), MATLAB Central File Exchange. Abgerufen .
Kompatibilität der MATLAB-Version
Erstellt mit
R2022b
Kompatibel mit allen Versionen
Plattform-Kompatibilität
Windows macOS LinuxTags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Live Editor erkunden
Erstellen Sie Skripte mit Code, Ausgabe und formatiertem Text in einem einzigen ausführbaren Dokument.
Version | Veröffentlicht | Versionshinweise | |
---|---|---|---|
1.0.0 |