mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-31 04:58:30 -04:00
AP_Math: make is_nan const for quaternion and add .zero() for vector2
This commit is contained in:
parent
1123c40761
commit
009913ec60
@ -47,7 +47,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
// check if any elements are NAN
|
// check if any elements are NAN
|
||||||
bool is_nan(void)
|
bool is_nan(void) const
|
||||||
{
|
{
|
||||||
return isnan(q1) || isnan(q2) || isnan(q3) || isnan(q4);
|
return isnan(q1) || isnan(q2) || isnan(q3) || isnan(q4);
|
||||||
}
|
}
|
||||||
|
@ -105,6 +105,12 @@ struct Vector2
|
|||||||
// check if any elements are infinity
|
// check if any elements are infinity
|
||||||
bool is_inf(void) const;
|
bool is_inf(void) const;
|
||||||
|
|
||||||
|
// zero the vector
|
||||||
|
void zero()
|
||||||
|
{
|
||||||
|
x = y = 0;
|
||||||
|
}
|
||||||
|
|
||||||
// gets the length of this vector squared
|
// gets the length of this vector squared
|
||||||
T length_squared() const
|
T length_squared() const
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user