Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mikolalysenko/left-right
Computes the orientation of 3 points in a plane
https://github.com/mikolalysenko/left-right
Last synced: 7 days ago
JSON representation
Computes the orientation of 3 points in a plane
- Host: GitHub
- URL: https://github.com/mikolalysenko/left-right
- Owner: mikolalysenko
- License: mit
- Created: 2013-09-19T19:13:37.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2014-06-05T15:37:22.000Z (over 10 years ago)
- Last Synced: 2024-12-16T22:35:06.096Z (10 days ago)
- Language: JavaScript
- Size: 141 KB
- Stars: 0
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
left-right
==========
Tests if 3 points are oriented clockwise, counter-clockwise or colinear.**WARNING** This module is deprecated. You should use [robust-orientation](https://www.npmjs.org/package/robust-orientation) instead.
## Example
```javascript
var lr = require("left-right")console.log(lr([1, 0], [0, 0], [0, 1]))
//Prints out: -1
```## Install
npm install left-right
## API### `require("left-right")(a, b, c)`
Computes the orientation of `a`, `b`, `c`* `a,b,c` are 3 2d points, encoded as arrays
**Returns** One of the following values:
* 1 if `a,b,c` are counter clockwise oriented
* -1 if `a,b,c` are clockwise
* 0 if they are colinear## Credits
(c) 2013 Mikola Lysenko. MIT License