Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/src/formula/spherical_lawofcosines.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ class Spherical_LawOfCosines {
cos(lat1) * cos(lat2) *
cos(lon2 - lon1)
);
if (distance < 0) distance = distance + PI;
if (distance < 0) distance = distance + pi;

var EarthRadius = 6378137.0; // WGS84 major axis
return EarthRadius * distance;
}
}
}
4 changes: 2 additions & 2 deletions lib/src/great_circle_distance_base.dart
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class GreatCircleDistance {
return Vincenty.distance(this.latitude1, this.longitude1, this.latitude2, this.longitude2);
}

double _radiansFromDegrees(final double degrees) => degrees * (PI / 180.0);
double _radiansFromDegrees(final double degrees) => degrees * (pi / 180.0);

/// A coordinate is considered invalid if it meets at least one of the following criteria:
///
Expand Down Expand Up @@ -94,4 +94,4 @@ class GreatCircleDistance {
throw new FormatException(
"Invalid coordinates at latitude2|longitude2\n$invalidDescription");
}
}
}
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ environment:
# path: ^1.4.1

dev_dependencies:
test: ^0.12.0
test: ^1.3.3