mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-15 01:23:37 +08:00
Vector: added norm_squared() because sometimes you can safe the sqrt operation
This commit is contained in:
@@ -71,6 +71,11 @@ public:
|
||||
return Type(sqrt(a.dot(a)));
|
||||
}
|
||||
|
||||
Type norm_squared() const {
|
||||
const Vector &a(*this);
|
||||
return Type(a.dot(a));
|
||||
}
|
||||
|
||||
inline Type length() const {
|
||||
return norm();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user