Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/michael-spengler/distance-calculator
🦕 Module to calculate distances based on latitude & longitude geocoordinates.
https://github.com/michael-spengler/distance-calculator
distance geography
Last synced: 26 days ago
JSON representation
🦕 Module to calculate distances based on latitude & longitude geocoordinates.
- Host: GitHub
- URL: https://github.com/michael-spengler/distance-calculator
- Owner: michael-spengler
- License: agpl-3.0
- Created: 2020-06-23T23:16:54.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-12-28T16:48:53.000Z (10 months ago)
- Last Synced: 2024-09-16T14:41:40.053Z (about 2 months ago)
- Topics: distance, geography
- Language: TypeScript
- Homepage:
- Size: 37.1 KB
- Stars: 8
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Distance Calculator
## Usage example for your code
```
import { DistanceCalculator } from "https://deno.land/x/distancecalculator/distance-calculator.ts"
const mannheimGeo = {
latitude: 49.4891,
longitude: 8.46694
}const heidelbergGeo = {
latitude: 49.40768,
longitude: 8.69079
}const distanceInKilometers =
DistanceCalculator.getDistanceInKilometers(heidelbergGeo.latitude, heidelbergGeo.longitude, mannheimGeo.latitude, mannheimGeo.longitude)const distanceInNauticMiles =
DistanceCalculator.getDistanceInNauticMiles(heidelbergGeo.latitude, heidelbergGeo.longitude, mannheimGeo.latitude, mannheimGeo.longitude)const distanceInLightYears =
DistanceCalculator.getDistanceInLightYears(heidelbergGeo.latitude, heidelbergGeo.longitude, mannheimGeo.latitude, mannheimGeo.longitude)console.log(`The distance between Mannheim and Heidelberg is: \n${distanceInKilometers} kilometers \n${distanceInNauticMiles} nautic miles \n${distanceInLightYears} light years`)
```
## Test it via command line
```
deno run --allow-net https://deno.land/x/distancecalculator/test-it.ts
```## Donations
Thanks to [Freedom Cash](https://FreedomCash.org), we are already free.
If you want to donate, you might consider donating to the [otherparty.co.uk](https://www.otherparty.co.uk/donate-crypto-the-other-party) to ensure people do not need to donate to victims but rather donate successfully to problem solvers.
![direct-democracy](https://github.com/michael-spengler/sleep/assets/145258627/fe97b7da-62b4-4cf6-9be0-7b03b2f3095a)