Browse Source

AP_Math: get_horizontal_cm() simplify

gps-1.3.1
Josh Henderson 3 years ago committed by Andrew Tridgell
parent
commit
28d9be1cc0
  1. 6
      libraries/AP_Math/location.cpp
  2. 8
      libraries/AP_Math/location.h

6
libraries/AP_Math/location.cpp

@ -23,12 +23,6 @@ @@ -23,12 +23,6 @@
#include "AP_Math.h"
#include "location.h"
// return horizontal distance between two positions in cm
float get_horizontal_distance_cm(const Vector2f &origin, const Vector2f &destination)
{
return (destination - origin).length();
}
// return bearing in centi-degrees between two positions
float get_bearing_cd(const Vector2f &origin, const Vector2f &destination)
{

8
libraries/AP_Math/location.h

@ -9,8 +9,12 @@ @@ -9,8 +9,12 @@
* LOCATION
*/
// return horizontal distance in centimeters between two positions
float get_horizontal_distance_cm(const Vector2f &origin, const Vector2f &destination);
// return horizontal distance between two positions in cm
template <typename T>
float get_horizontal_distance_cm(const Vector2<T> &origin, const Vector2<T> &destination)
{
return (destination - origin).length();
}
// return bearing in centi-degrees between two positions
float get_bearing_cd(const Vector2f &origin, const Vector2f &destination);

Loading…
Cancel
Save