From b0655a55d7bf1934ebc7299d846cfda9312578c7 Mon Sep 17 00:00:00 2001 From: Gold87 <91761103+Gold872@users.noreply.github.com> Date: Sat, 14 Dec 2024 00:28:56 -0500 Subject: [PATCH] Corrected directions --- lib/src/imu/cardinal_direction.dart | 8 ++++---- lib/src/utils/gps_utils.dart | 12 ++++++------ 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/lib/src/imu/cardinal_direction.dart b/lib/src/imu/cardinal_direction.dart index 40b2521..410e456 100644 --- a/lib/src/imu/cardinal_direction.dart +++ b/lib/src/imu/cardinal_direction.dart @@ -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); diff --git a/lib/src/utils/gps_utils.dart b/lib/src/utils/gps_utils.dart index 7e56f0e..ac49d42 100644 --- a/lib/src/utils/gps_utils.dart +++ b/lib/src/utils/gps_utils.dart @@ -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