AP_Math: added is_nan() methods to vector3f and matrix3f

This commit is contained in:
Andrew Tridgell 2012-02-23 22:55:59 +11:00
parent 2a4b7facaa
commit 7dd909a16b
2 changed files with 8 additions and 0 deletions

View File

@ -124,6 +124,10 @@ public:
Matrix3<T> transpose(void)
{ return *this = transposed(); }
// check if any elements are NAN
bool is_nan(void)
{ return a.is_nan() || b.is_nan() || c.is_nan(); }
};
typedef Matrix3<int16_t> Matrix3i;

View File

@ -173,6 +173,10 @@ public:
T angle_normalized(const Vector3<T> &v1, const Vector3<T> &v2)
{ return (T)acosf(v1*v2); }
// check if any elements are NAN
bool is_nan(void)
{ return isnan(x) || isnan(y) || isnan(z); }
};
typedef Vector3<int16_t> Vector3i;