Added unit function that returns normalized vector.

This commit is contained in:
James Goppert
2016-03-15 18:09:48 -04:00
parent 0e14e11183
commit 711b57d2d4
2 changed files with 10 additions and 4 deletions
+6 -2
View File
@@ -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 {