mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-06-02 03:36:48 +08:00
Vector: switch read only functions to const (#108)
This commit is contained in:
committed by
Julian Kent
parent
a172c3cdac
commit
de85dcff97
+2
-3
@@ -92,7 +92,7 @@ public:
|
|||||||
return (*this) / norm();
|
return (*this) / norm();
|
||||||
}
|
}
|
||||||
|
|
||||||
Vector unit_or_zero(const Type eps = Type(1e-5)) {
|
Vector unit_or_zero(const Type eps = Type(1e-5)) const {
|
||||||
const Type n = norm();
|
const Type n = norm();
|
||||||
if (n > eps) {
|
if (n > eps) {
|
||||||
return (*this) / n;
|
return (*this) / n;
|
||||||
@@ -104,8 +104,7 @@ public:
|
|||||||
return unit();
|
return unit();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool longerThan(Type testVal)
|
bool longerThan(Type testVal) const {
|
||||||
{
|
|
||||||
return norm_squared() > testVal*testVal;
|
return norm_squared() > testVal*testVal;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user