Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

volo-great-circle

license

Great-circle distance, bearing and midpoint between coordinates — the haversine math behind every flight-distance estimate. Zero dependencies.

Part of VOLO's open aviation toolkit.

Install

npm install volo-great-circle
const { distance, bearing } = require("volo-great-circle");

const JFK = { lat: 40.6413, lon: -73.7781 };
const LHR = { lat: 51.4700, lon: -0.4543 };

distance(JFK, LHR, "nm"); // → 2991  (nautical miles)
distance(JFK, LHR, "km"); // → 5540
bearing(JFK, LHR);        // → 51    (degrees, initial bearing)

API

Function Returns
distance(a, b, unit?) great-circle distance — unit"nm" | "km" | "mi" | "m" (default nm)
bearing(a, b) initial bearing in degrees (0–360)
midpoint(a, b) { lat, lon } of the great-circle midpoint

Points are { lat, lon } in decimal degrees.

About

Built by VOLO — the world's first agent-native private aviation platform. See more open tools and the live charter API at flyvolo.ai/open-source.

License

MIT © VOLO Technologies Pte. Ltd.

About

Great-circle distance, bearing & midpoint (haversine). Zero deps. By VOLO.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages