Browse Source

AP_Math: rename get_bearing() to get_bearing_cd() to make units obvious

master
Andrew Tridgell 13 years ago
parent
commit
8ae35cae1c
  1. 2
      libraries/AP_Math/AP_Math.h
  2. 2
      libraries/AP_Math/location.cpp

2
libraries/AP_Math/AP_Math.h

@ -37,7 +37,7 @@ float get_distance(const struct Location *loc1, const struct Location *loc2); @@ -37,7 +37,7 @@ float get_distance(const struct Location *loc1, const struct Location *loc2);
int32_t get_distance_cm(const struct Location *loc1, const struct Location *loc2);
// return bearing in centi-degrees between two locations
int32_t get_bearing(const struct Location *loc1, const struct Location *loc2);
int32_t get_bearing_cd(const struct Location *loc1, const struct Location *loc2);
// see if location is past a line perpendicular to
// the line between point1 and point2. If point1 is

2
libraries/AP_Math/location.cpp

@ -61,7 +61,7 @@ int32_t get_distance_cm(const struct Location *loc1, const struct Location *loc2 @@ -61,7 +61,7 @@ int32_t get_distance_cm(const struct Location *loc1, const struct Location *loc2
}
// return bearing in centi-degrees between two locations
int32_t get_bearing(const struct Location *loc1, const struct Location *loc2)
int32_t get_bearing_cd(const struct Location *loc1, const struct Location *loc2)
{
int32_t off_x = loc2->lng - loc1->lng;
int32_t off_y = (loc2->lat - loc1->lat) / longitude_scale(loc2);

Loading…
Cancel
Save