New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

haversine-matrix

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

haversine-matrix

Returns distance matrix for collection of latitude/longitude points using the Haversine formula

latest
npmnpm
Version
1.0.1
Version published
Maintainers
1
Created
Source

haversine-matrix

Returns distance matrix for collection of latitude/longitude points using the Haversine formula. Haversime formula is accurate for most geospatial applications as long as it assumes a perfect sphere.

Installation

npm install haversine-matrix

Usage

import matrix from "haversine-matrix";

matrix([
  { latitude: 40.7128, longitude: -74.006 },
  { latitude: 34.0522, longitude: -118.2437 },
]);
// => [ [ 0, 3940155.2046990567 ], [ 3940155.2046990567, 0 ] ]

matrix([
  { latitude: 40.7128, longitude: -74.006 },
  { latitude: 40.7128, longitude: -74.006 },
]);
// => [ [ 0, 0 ], [ 0, 0 ] ]

Keywords

haversine

FAQs

Package last updated on 22 Jun 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts