Skip to content

Latest commit

 

History

History
25 lines (19 loc) · 520 Bytes

README.md

File metadata and controls

25 lines (19 loc) · 520 Bytes

Haversine

Yet another Haversine formula service.

Installation

composer require faicchia/haversine

Usage

$distance = Haversine::kilometers(
    from: Point::new(latitude: 41.902782, longitude: 12.496366), // Rome
    to: Point::new(latitude: 51.509865, longitude: -0.118092)    // London
);
// 1433.47926

$distance = Haversine::miles(
    from: Point::new(latitude: 41.902782, longitude: 12.496366), 
    to: Point::new(latitude: 51.509865, longitude: -0.118092)    
);
// 890.722441