Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mikolalysenko/compare-oriented-cell
Test if two sequences of integers are equal up to an even permutation
https://github.com/mikolalysenko/compare-oriented-cell
Last synced: 2 months ago
JSON representation
Test if two sequences of integers are equal up to an even permutation
- Host: GitHub
- URL: https://github.com/mikolalysenko/compare-oriented-cell
- Owner: mikolalysenko
- License: mit
- Created: 2015-06-20T16:50:13.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-06-20T18:28:08.000Z (over 9 years ago)
- Last Synced: 2024-10-20T14:28:16.226Z (2 months ago)
- Language: JavaScript
- Size: 117 KB
- Stars: 0
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
compare-oriented-cell
=====================
This module defines an ordering on oriented cells. It is similar to `compare-cell`, except that it considers cells which are oriented clockwise/counter clockwise to be distinct.# Example
```javascript
var compare = require('compare-oriented-cell')//Create 3 triangles
var a = [0, 1, 2]
var b = [1, 2, 0]
var c = [1, 0, 2]//Triangle a and b are equivalent up to an even permutation
console.log(compare(a, b) === 0)//Triangle a and c are different as they not oriented the same
console.log(compare(a, c) === 0)
```# Install
```
npm i compare-oriented-cell
```# API
#### `require('compare-oriented-cell')(a, b)`
Compares two oriented cells.* `a, b` are lists of integers
**Returns** `+/-1` if `a` and `b` are different, `0` otherwise
# License
(c) 2015 Mikola Lysenko. MIT License