https://github.com/semibran/manhattan
:straight_ruler: Calculate the Manhattan distance between two points
https://github.com/semibran/manhattan
distance geometry manhattan
Last synced: over 1 year ago
JSON representation
:straight_ruler: Calculate the Manhattan distance between two points
- Host: GitHub
- URL: https://github.com/semibran/manhattan
- Owner: semibran
- License: mit
- Created: 2017-06-21T01:02:13.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2017-07-16T02:58:55.000Z (almost 9 years ago)
- Last Synced: 2024-10-20T12:54:44.586Z (over 1 year ago)
- Topics: distance, geometry, manhattan
- Language: JavaScript
- Homepage:
- Size: 4.88 KB
- Stars: 5
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: license
Awesome Lists containing this project
README
# manhattan
> Calculate the [Manhattan distance](https://en.wikipedia.org/wiki/Manhattan_distance) between two points

This module exposes the function `distance(a, b)`, which determines the Manhattan distance between points `a` and `b`.
```js
> const distance = require('manhattan')
> distance([2, 5], [4, 8])
5
```
[](https://www.npmjs.com/package/manhattan)
## see also
- [`semibran/euclidean`](https://github.com/semibran/euclidean) - calculate Euclidean distance
- [`semibran/chebyshev`](https://github.com/semibran/chebyshev) - calculate Chebyshev distance
- [`semibran/vector`](https://github.com/semibran/vector) - more vector math
- [`kchapelier/von-neumann`](https://github.com/kchapelier/von-neumann) - find all points within a given Manhattan distance
## license
[MIT](https://opensource.org/licenses/MIT) © [Brandon Semilla](https://git.io/semibran)