From b31e5bf055b77cb9daa40110eacc04b07bd95fb4 Mon Sep 17 00:00:00 2001 From: Pierre Kancir Date: Fri, 5 Apr 2019 08:11:26 +0200 Subject: [PATCH] AP_Math: move location_update to Location and rename to offset_bearing --- libraries/AP_Math/location.cpp | 14 +------------- libraries/AP_Math/location.h | 3 --- 2 files changed, 1 insertion(+), 16 deletions(-) diff --git a/libraries/AP_Math/location.cpp b/libraries/AP_Math/location.cpp index cd4303b388..230fedb21e 100644 --- a/libraries/AP_Math/location.cpp +++ b/libraries/AP_Math/location.cpp @@ -73,19 +73,7 @@ float location_path_proportion(const struct Location &location, return (vec1 * vec2) / dsquared; } -/* - * extrapolate latitude/longitude given bearing and distance - * Note that this function is accurate to about 1mm at a distance of - * 100m. This function has the advantage that it works in relative - * positions, so it keeps the accuracy even when dealing with small - * distances and floating point numbers - */ -void location_update(struct Location &loc, float bearing, float distance) -{ - float ofs_north = cosf(radians(bearing))*distance; - float ofs_east = sinf(radians(bearing))*distance; - loc.offset(ofs_north, ofs_east); -} + /* return the distance in meters in North/East plane as a N/E vector diff --git a/libraries/AP_Math/location.h b/libraries/AP_Math/location.h index 635becdcd3..5cdb4e73cb 100644 --- a/libraries/AP_Math/location.h +++ b/libraries/AP_Math/location.h @@ -42,9 +42,6 @@ float location_path_proportion(const struct Location &location, const struct Location &point1, const struct Location &point2); -// extrapolate latitude/longitude given bearing and distance -void location_update(struct Location &loc, float bearing, float distance); - /* return the distance in meters in North/East plane as a N/E vector from loc1 to loc2