Skip to content

Commit

Permalink
Corrected directions
Browse files Browse the repository at this point in the history
  • Loading branch information
Gold872 committed Dec 14, 2024
1 parent c0d71ae commit b0655a5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions lib/src/imu/cardinal_direction.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ enum CardinalDirection {
west(90),
south(180),
east(270),
northEast(000 + 45),
northWest(360 - 45),
southWest(180 + 45),
southEast(180 - 45);
northEast(0 - 45),
northWest(0 + 45),
southWest(180 - 45),
southEast(180 + 45);

final double angle;
const CardinalDirection(this.angle);
Expand Down
12 changes: 6 additions & 6 deletions lib/src/utils/gps_utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ extension GpsUtils on GpsCoordinates {
static double get movementLatitude => moveLengthMeters * latitudePerMeter;
static double get movementLongitude => moveLengthMeters * longitudePerMeter;

static GpsCoordinates get east => GpsCoordinates(longitude: -movementLongitude);
static GpsCoordinates get west => GpsCoordinates(longitude: movementLongitude);
static GpsCoordinates get east => GpsCoordinates(longitude: movementLongitude);
static GpsCoordinates get west => GpsCoordinates(longitude: -movementLongitude);
static GpsCoordinates get north => GpsCoordinates(latitude: movementLatitude);
static GpsCoordinates get south => GpsCoordinates(latitude: -movementLatitude);
static GpsCoordinates get northEast => GpsCoordinates(latitude: movementLatitude, longitude: -movementLongitude);
static GpsCoordinates get northWest => GpsCoordinates(latitude: movementLatitude, longitude: movementLongitude);
static GpsCoordinates get southEast => GpsCoordinates(latitude: -movementLatitude, longitude: -movementLongitude);
static GpsCoordinates get southWest => GpsCoordinates(latitude: -movementLatitude, longitude: movementLongitude);
static GpsCoordinates get northEast => GpsCoordinates(latitude: movementLatitude, longitude: movementLongitude);
static GpsCoordinates get northWest => GpsCoordinates(latitude: movementLatitude, longitude: -movementLongitude);
static GpsCoordinates get southEast => GpsCoordinates(latitude: -movementLatitude, longitude: movementLongitude);
static GpsCoordinates get southWest => GpsCoordinates(latitude: -movementLatitude, longitude: -movementLongitude);

// Taken from https://stackoverflow.com/a/39540339/9392211
static const metersPerLatitude = 111.32 * 1000; // 111.32 km
Expand Down

0 comments on commit b0655a5

Please sign in to comment.