### Import Haversine Distance Source: https://github.com/dcousens/haversine-distance/blob/main/README.md Demonstrates how to import the haversine-distance function using both CommonJS and ES Module syntax. ```javascript const haversine = require('haversine-distance') // or import haversine from 'haversine-distance' ``` -------------------------------- ### Usage with Alternative Coordinate Keys Source: https://github.com/dcousens/haversine-distance/blob/main/README.md Illustrates the flexibility of the haversine function by accepting coordinate objects with alternative keys such as 'lat', 'lng', and 'lon'. This allows for mixed usage and easier integration with different data sources. ```javascript const a = { lat: 37.8136, lng: 144.9631 } const b = { lat: 33.8650, lon: 151.2094 } console.log(haversine(a, b)) // 714504.18 (in meters) ``` -------------------------------- ### Usage with Standard Lat/Lon Objects Source: https://github.com/dcousens/haversine-distance/blob/main/README.md Shows the basic usage of the haversine function with two objects, each containing 'latitude' and 'longitude' properties. The output is the distance in meters. ```javascript const a = { latitude: 37.8136, longitude: 144.9631 } const b = { latitude: 33.8650, longitude: 151.2094 } console.log(haversine(a, b)) // 714504.18 (in meters) ``` -------------------------------- ### Usage with GeoJSON Coordinate Arrays Source: https://github.com/dcousens/haversine-distance/blob/main/README.md Demonstrates how to use the haversine function with GeoJSON-formatted coordinate arrays, where each array represents a point as [longitude, latitude]. This is useful when working with GeoJSON data directly. ```javascript const a = [144.9631, 37.8136] const b = [151.2094, 33.865] console.log(haversine(a, b)) // 714504.18 (in meters) ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.