MCPcopy Create free account
hub / github.com/BinomialLLC/basis_universal / normalize3

Method normalize3

example_transcoding/utils.h:1031–1042  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1029 }
1030
1031 inline double normalize3(const vec* pDefaultVec = NULL)
1032 {
1033 ASSUME(N >= 3);
1034
1035 double n = m_s[0] * m_s[0] + m_s[1] * m_s[1] + m_s[2] * m_s[2];
1036
1037 if (n != 0)
1038 *this *= static_cast<T>((1.0f / sqrt(n)));
1039 else if (pDefaultVec)
1040 *this = *pDefaultVec;
1041 return n;
1042 }
1043
1044 inline vec& normalize_in_place(const vec* pDefaultVec = NULL)
1045 {

Callers 1

get_normalized3Method · 0.45

Calls 1

sqrtFunction · 0.85

Tested by

no test coverage detected