6#include <Common/assertion.h>
13template<
typename Derived,
typename T, std::
size_t N>
16 return ::ph::math::dot_product(m, rhs.Self::m);
19template<
typename Derived,
typename T, std::
size_t N>
25template<
typename Derived,
typename T, std::
size_t N>
28 return std::abs(dot(rhs));
31template<
typename Derived,
typename T, std::
size_t N>
34 return std::abs(dot(rhs));
37template<
typename Derived,
typename T, std::
size_t N>
40 return ::ph::math::length(m);
43template<
typename Derived,
typename T, std::
size_t N>
46 return ::ph::math::length_squared(m);
49template<
typename Derived,
typename T, std::
size_t N>
53 return Derived(
static_cast<const Derived&
>(*
this)).normalizeLocal();
56template<
typename Derived,
typename T, std::
size_t N>
62 return static_cast<Derived&
>(*this);
65template<
typename Derived,
typename T, std::
size_t N>
70 return !normalized.isZero() && normalized.isFinite() ? normalized : fallback;
73template<
typename Derived,
typename T, std::
size_t N>
77 return this->minIndex();
80template<
typename Derived,
typename T, std::
size_t N>
84 return this->maxIndex();
T length() const
Definition TVectorNBase.ipp:38
Derived & normalizeLocal()
Definition TVectorNBase.ipp:57
T dot(const Derived &rhs) const
Definition TVectorNBase.ipp:14
Derived normalize() const
Normalize the vector. Notice that normalizing a integer typed vector will result in 0-vector most of ...
Definition TVectorNBase.ipp:50
Derived safeNormalize(const Derived &fallback=Derived{}) const
Definition TVectorNBase.ipp:66
T absDot(const Derived &rhs) const
Definition TVectorNBase.ipp:26
T lengthSquared() const
Definition TVectorNBase.ipp:44
std::size_t maxDimension() const
Definition TVectorNBase.ipp:81
std::size_t minDimension() const
Definition TVectorNBase.ipp:74
Miscellaneous math utilities.
Math functions and utilities.
Definition TransformInfo.h:10
void normalize(std::array< T, N > &vec)
Treating input values as a vector and normalize it. Notice that normalizing a integer typed vector wi...
Definition math.ipp:142