Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mikolalysenko/robust-point-in-simplex
Exact geometric predicate to test if a point is contained in a simplex
https://github.com/mikolalysenko/robust-point-in-simplex
Last synced: 6 days ago
JSON representation
Exact geometric predicate to test if a point is contained in a simplex
- Host: GitHub
- URL: https://github.com/mikolalysenko/robust-point-in-simplex
- Owner: mikolalysenko
- License: mit
- Created: 2013-10-22T23:31:49.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2014-05-07T01:43:36.000Z (over 10 years ago)
- Last Synced: 2024-12-16T22:35:35.146Z (9 days ago)
- Language: JavaScript
- Size: 148 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
robust-point-in-simplex
=======================
Exact point in simplex predicate.## Example
```javascript
var pointInSimplex = require("robust-point-in-simplex")var simplex = [
[0,0],
[0,1],
[1,0]
]console.log(pointInSimplex(simplex, [0.25, 0.25]))
```### `require("robust-point-in-simplex")(simplex, point)`
Exactly tests if a given point is contained in a simplex.* `simplex` is an array of `n+1` points
* `point` is a length `n` array of floats**Returns** An integer indicating where the point lies on the simplex
* `>0` if the point is contained in the simplex
* `<0` if the point is outside the simplex
* `0` if the point lies on the boundary of the simplex## Credits
(c) 2013 Mikola Lysenko. MIT License