flutter_map_math 0.1.0
flutter_map_math: ^0.1.0 copied to clipboard
Map realated calculations in one place. Like finding distance, mid point, bearing angle of two points.And finding destination point.Also convert degrees to radians and vice-versa
example/example.md
double distance = FlutterMapMath.distanceBetween(
37.4219999,
-122.0840575,
37.4220011,
-122.0866519,
"meters"
);
double bearing = FlutterMapMath.bearingBetween(
37.4219999,
-122.0840575,
37.4220011,
-122.0866519,
);
LatLng startingPoint = LatLng(37.4219999, -122.0840575);
double distance = 1000;
double bearing = 90;
LatLng destinationPoint = FlutterMapMath.destinationPoint(startingPoint, distance, bearing);
LatLng point1 = LatLng(37.4219999, -122.0840575);
LatLng point2 = LatLng(37.4220011, -122.0866519);
LatLng midpoint = FlutterMapMath.midpointBetween(point1, point2);
double lat1 = 40.7128; // New York City
double lon1 = -74.0060;
double bearing1 = 45.0; // Degrees
double lat2 = 51.5074; // London
double lon2 = -0.1278;
double bearing2 = 180.0; // Degrees
LatLng intersection = calculateIntersection(lat1, lon1, bearing1, lat2, lon2, bearing2);