More accurate radius
This commit is contained in:
parent
9d18623e22
commit
52182b15bb
1 changed files with 1 additions and 1 deletions
|
|
@ -90,7 +90,7 @@ class GeolocationService {
|
||||||
}
|
}
|
||||||
|
|
||||||
static double _distance(Location from, bg.Location to) {
|
static double _distance(Location from, bg.Location to) {
|
||||||
const earthRadius = 6371000; // meters
|
const earthRadius = 6371008.8; // meters
|
||||||
final dLat = _degToRad(to.coords.latitude - from.latitude);
|
final dLat = _degToRad(to.coords.latitude - from.latitude);
|
||||||
final dLon = _degToRad(to.coords.longitude - from.longitude);
|
final dLon = _degToRad(to.coords.longitude - from.longitude);
|
||||||
final a = sin(dLat / 2) * sin(dLat / 2) +
|
final a = sin(dLat / 2) * sin(dLat / 2) +
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue