mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-05-02 05:04:08 +08:00
Vector: switch read only functions to const (#108)
This commit is contained in:
parent
a172c3cdac
commit
de85dcff97
@ -92,7 +92,7 @@ public:
|
||||
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();
|
||||
if (n > eps) {
|
||||
return (*this) / n;
|
||||
@ -104,8 +104,7 @@ public:
|
||||
return unit();
|
||||
}
|
||||
|
||||
bool longerThan(Type testVal)
|
||||
{
|
||||
bool longerThan(Type testVal) const {
|
||||
return norm_squared() > testVal*testVal;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user