mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-02-22 15:53:56 -04:00
AP_Math: added is_nan() methods to vector3f and matrix3f
This commit is contained in:
parent
2a4b7facaa
commit
7dd909a16b
@ -124,6 +124,10 @@ public:
|
|||||||
Matrix3<T> transpose(void)
|
Matrix3<T> transpose(void)
|
||||||
{ return *this = transposed(); }
|
{ 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;
|
typedef Matrix3<int16_t> Matrix3i;
|
||||||
|
@ -173,6 +173,10 @@ public:
|
|||||||
T angle_normalized(const Vector3<T> &v1, const Vector3<T> &v2)
|
T angle_normalized(const Vector3<T> &v1, const Vector3<T> &v2)
|
||||||
{ return (T)acosf(v1*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;
|
typedef Vector3<int16_t> Vector3i;
|
||||||
|
Loading…
Reference in New Issue
Block a user