MCPcopy Index your code
hub / github.com/Audio4Linux/JDSP4Linux / normalize

Method normalize

3rdparty/qcustomplot/qcustomplot.cpp:161–167  ·  view source on GitHub ↗

! Normalizes this vector. After this operation, the length of the vector is equal to 1. If the vector has both entries set to zero, this method does nothing. \see normalized, length, lengthSquared */

Source from the content-addressed store, hash-verified

159 \see normalized, length, lengthSquared
160*/
161void QCPVector2D::normalize()
162{
163 if (mX == 0.0 && mY == 0.0) return;
164 const double lenInv = 1.0/length();
165 mX *= lenInv;
166 mY *= lenInv;
167}
168
169/*!
170 Returns a normalized version of this vector. The length of the returned vector is equal to 1.

Callers 5

sanitizedForLogScaleMethod · 0.80
sanitizedForLinScaleMethod · 0.80
getAnchorPosMethod · 0.80
getKeyRangeMethod · 0.80
getValueRangeMethod · 0.80

Calls 1

lengthFunction · 0.85

Tested by

no test coverage detected