manhattan

Calculate the Manhattan distance between two points

Usage no npm install needed!

<script type="module">
  import manhattan from 'https://cdn.skypack.dev/manhattan';
</script>

README

manhattan

Calculate the Manhattan distance between two points

Manhattan distance

This module exposes the function distance(a, b), which determines the Manhattan distance between points a and b.

> const distance = require('manhattan')
> distance([2, 5], [4, 8])
5

NPM

see also

license

MIT © Brandon Semilla