Skip to content

xnerhu/spatium

Repository files navigation

Spatium

Calculate the distance between two points.

Installation

$ npm install spatium

Example

import distance, { IPosition } from 'spatium';

const first: IPosition = [1205, 40];
const second: IPosition = [85, 575];

console.log(Math.floor(distance(first, second))); // 1241