haversine

Crates.iohaversine
lib.rshaversine
version0.2.1
sourcesrc
created_at2015-06-26 02:32:18.586891
updated_at2015-12-11 23:53:29.779383
descriptionhaversine implemented in rust
homepagehttps://github.com/visualjeff/haversine
repositoryhttps://github.com/visualjeff/haversine.git
max_upload_size
id2468
size3,774
Jeff (visualjeff)

documentation

https://github.com/visualjeff/haversine

README

haversine

haversine implemented in rust

Add haversine dependency to your project Cargo.toml file:

[dependencies]
haversine = "0.2.1"

Example usage:

extern crate haversine;

use haversine::{distance, Location};

fn main() {
    let start1 = haversine::Location{latitude: 38.898556,longitude: -77.037852};
    let end1 = haversine::Location{latitude: 38.897147, longitude: -77.043934};
    println!("{}", haversine::distance(start1, end1, haversine::Units::Miles));

    let start2 = haversine::Location{latitude: 38.898556,longitude: -77.037852};
    let end2 = haversine::Location{latitude: 38.897147, longitude: -77.043934};
    println!("{}", haversine::distance(start2, end2, haversine::Units::Kilometers));
}
Commit count: 8

cargo fmt