haversine 1.0.2 copy "haversine: ^1.0.2" to clipboard
haversine: ^1.0.2 copied to clipboard

Calculate geographic distance on earth having a pair of Latitude/Longitude points using the Haversine formula.

example/haversine_example.dart

// Copyright (c) 2017, yeradis. All rights reserved. Use of this source code
// is governed by a BSD-style license that can be found in the LICENSE file.

import 'package:haversine/haversine.dart';

main() {
    final lat1 = 41.139129;
    final lon1 = 1.402244;

    final lat2 = 41.139074;
    final lon2 = 1.402315;

    final harvesine = new Haversine.fromDegrees(latitude1: lat1,
                                               longitude1: lon1,
                                                latitude2: lat2,
                                               longitude2: lon2);

    print('Distance from location 1 to 2 is : ${harvesine.distance()}');
}
7
likes
40
pub points
37%
popularity

Publisher

verified publisheryeradis.com

Calculate geographic distance on earth having a pair of Latitude/Longitude points using the Haversine formula.

Homepage

License

MIT (LICENSE)

More

Packages that depend on haversine