From 0b897e04bbfb426ad061d01bc6de81c927c293f9 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 5 May 2015 12:35:31 +1000 Subject: [PATCH] AP_Math: revert AP_Math class change --- libraries/AP_Math/location.cpp | 4 ++-- libraries/AP_Math/vector2.cpp | 4 ++-- libraries/AP_Math/vector3.cpp | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/libraries/AP_Math/location.cpp b/libraries/AP_Math/location.cpp index 558a5dc4a7..9e9bff9aef 100644 --- a/libraries/AP_Math/location.cpp +++ b/libraries/AP_Math/location.cpp @@ -128,7 +128,7 @@ void location_update(struct Location &loc, float bearing, float distance) */ void location_offset(struct Location &loc, float ofs_north, float ofs_east) { - if (!AP_Math::is_zero(ofs_north) || !AP_Math::is_zero(ofs_east)) { + if (!is_zero(ofs_north) || !is_zero(ofs_east)) { int32_t dlat = ofs_north * LOCATION_SCALING_FACTOR_INV; int32_t dlng = (ofs_east * LOCATION_SCALING_FACTOR_INV) / longitude_scale(loc); loc.lat += dlat; @@ -254,7 +254,7 @@ void wgsecef2llh(const Vector3d &ecef, Vector3d &llh) { const double p = sqrt(ecef[0]*ecef[0] + ecef[1]*ecef[1]); /* Compute longitude first, this can be done exactly. */ - if (!AP_Math::is_zero(p)) + if (!is_zero(p)) llh[1] = atan2(ecef[1], ecef[0]); else llh[1] = 0; diff --git a/libraries/AP_Math/vector2.cpp b/libraries/AP_Math/vector2.cpp index 99f1f364e1..7e1d12d407 100644 --- a/libraries/AP_Math/vector2.cpp +++ b/libraries/AP_Math/vector2.cpp @@ -113,13 +113,13 @@ Vector2 Vector2::operator -(void) const template bool Vector2::operator ==(const Vector2 &v) const { - return (AP_Math::is_equal(x,v.x) && AP_Math::is_equal(y,v.y)); + return (is_equal(x,v.x) && is_equal(y,v.y)); } template bool Vector2::operator !=(const Vector2 &v) const { - return (!AP_Math::is_equal(x,v.x) || !AP_Math::is_equal(y,v.y)); + return (!is_equal(x,v.x) || !is_equal(y,v.y)); } template diff --git a/libraries/AP_Math/vector3.cpp b/libraries/AP_Math/vector3.cpp index 7e6421304a..a58496ed19 100644 --- a/libraries/AP_Math/vector3.cpp +++ b/libraries/AP_Math/vector3.cpp @@ -327,13 +327,13 @@ Vector3 Vector3::operator -(void) const template bool Vector3::operator ==(const Vector3 &v) const { - return (AP_Math::is_equal(x,v.x) && AP_Math::is_equal(y,v.y) && AP_Math::is_equal(z,v.z)); + return (is_equal(x,v.x) && is_equal(y,v.y) && is_equal(z,v.z)); } template bool Vector3::operator !=(const Vector3 &v) const { - return (!AP_Math::is_equal(x,v.x) || !AP_Math::is_equal(y,v.y) || !AP_Math::is_equal(z,v.z)); + return (!is_equal(x,v.x) || !is_equal(y,v.y) || !is_equal(z,v.z)); } template