mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-17 07:13:33 +08:00
Added unit function that returns normalized vector.
This commit is contained in:
+6
-2
@@ -66,8 +66,12 @@ public:
|
||||
return Type(sqrt(a.dot(a)));
|
||||
}
|
||||
|
||||
Vector normalize() const {
|
||||
return (*this) / norm();
|
||||
inline void normalize() {
|
||||
(*this) /= norm();
|
||||
}
|
||||
|
||||
Vector unit() const {
|
||||
return (*this) / norm();
|
||||
}
|
||||
|
||||
Vector pow(Type v) const {
|
||||
|
||||
Reference in New Issue
Block a user