compare-oriented-cell
Test if two sets of integers are equal up to an even permutation
Last updated 10 years ago by mikolalysenko .
MIT · Repository · Bugs · Original npm
$ cnpm install compare-oriented-cell 
SYNC missed versions from official npm registry.

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

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

Current Tags

  • 1.0.1                                ...           latest (10 years ago)

1 Versions

  • 1.0.1                                ...           10 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (2)
Dev Dependencies (2)
Dependents (0)
None

Copyright 2013 - present © cnpmjs.org