Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mikolalysenko/convex-minkowski-sum
Computes the Minkowski sum of two convex polytopes
https://github.com/mikolalysenko/convex-minkowski-sum
Last synced: about 2 months ago
JSON representation
Computes the Minkowski sum of two convex polytopes
- Host: GitHub
- URL: https://github.com/mikolalysenko/convex-minkowski-sum
- Owner: mikolalysenko
- License: mit
- Created: 2014-12-08T05:35:31.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2014-12-08T05:38:33.000Z (about 10 years ago)
- Last Synced: 2024-10-19T00:19:20.922Z (2 months ago)
- Language: JavaScript
- Size: 113 KB
- Stars: 18
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
convex-minkowski-sum
====================
Computes the [Minkowski sum](https://en.wikipedia.org/wiki/Minkowski_addition) of two convex polytopes encoded as sets of points# Example
```javascript
var msum = require('convex-minkowski-sum')//A is a triangle in 3D
var A = [[1,0,0], [0,1,0], [1,1,0]]//B is a line segment
var B = [[0,-1,0], [0,1,0]]console.log(msum(A,B))
```# Install
```sh
npm install convex-minkowski-sum
```# API
```javascript
var msum = require('convex-minkowski-sum')
```#### `msum(A,B)`
Computes the Minkowski sum of `A` and `B`* `A` and `B` are both arrays of vertices encoded as d-tuples of points
**Returns** A set of points representing the Minkowski sum of `A` and `B`
#### `msum.pairs(A,B)`
Computes a set of pairs representing the vertices of the Minkowski sum of `A` and `B`* `A` and `B` are arrays of points
**Returns** An array of pairs representing the vertices on the convex hull of the Minkowski sum of `A` and `B`
#### `msum.faces(A,B)`
Computes the faces of the Minkowski sum of `A` and `B`* `A` and `B` are arrays of points
**Returns** An array of the faces of the Minkowski sum of `A` and `B` represented as pairs of lists of vertices in `A` and `B` respectively.
# Credits
(c) 2014 Mikola Lysenko. MIT License