Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mikolalysenko/triangulate-hypercube
Triangulates a hypercube into simplices
https://github.com/mikolalysenko/triangulate-hypercube
Last synced: about 2 months ago
JSON representation
Triangulates a hypercube into simplices
- Host: GitHub
- URL: https://github.com/mikolalysenko/triangulate-hypercube
- Owner: mikolalysenko
- License: mit
- Created: 2014-04-08T17:50:23.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2014-09-18T23:43:30.000Z (over 10 years ago)
- Last Synced: 2024-10-20T14:27:56.302Z (2 months ago)
- Language: JavaScript
- Size: 160 KB
- Stars: 3
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
triangulate-hypercube
=====================
Triangulates an n-dimensional hypercube into a collection of simplices.**Note:** In high dimensions, this triangulation is not very efficient. Pull requests welcome.
# Example
```javascript
var triangulateCube = require("triangulate-hypercube")console.log(triangulateCube(2))
```Output:
```javascript
[ [ 3, 2, 0 ], [ 0, 1, 3 ] ]
```# Install
```
npm install triangulate-hypercube
```# API
#### `require("triangulate-hypercube")(dimension)`
Computes a decomposition of an n-dimensional hypercube into simplices using a naive permutation based algorithm.* `dimension` is an integer representing the dimension of the hypercube to triangulate
**Returns** A list of `n` dimensional simplices which subdivide the cube.
# Credits
(c) 2014 Mikola Lysenko. MIT License