Skip to content

Simple implementation of the Haversine formula in Rust

License

Notifications You must be signed in to change notification settings

csnje/haversine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

About

Simple implementation of the Haversine formula for calculating the distance between two locations on an earth mean radius sphere.

Usage

The program expects four arguments in a specific order, being:

  • latitude of the first position
  • longitude of the first position
  • latitude of the second position
  • longitude of the second position

where the values are given in decimal degrees.

The result is in meters.

Example

The distance between the Brisbane GPO at 27.4679° S, 153.0280° E and the Sydney GPO at 33.8676° S, 151.2075° E may be determined by running:

haversine -27.4679 152.028 -33.8676 151.2075

Limitations

As this is intended to be a simple implementation no error checking is performed.

About

Simple implementation of the Haversine formula in Rust

Topics

Resources

License

Stars

Watchers

Forks

Languages