7 ms·
It is the inverse of the square root. If you want to normalise a vector, you divide the components by the length. The length is the sqrt of the sum squares (Pyt
by meta_AU 8y ago
It is the inverse of the square root. If you want to normalise a vector, you divide the components by the length. The length is the sqrt of the sum squares (Pythagoras). Divide is more expensive than multiply. So get the inverse sqrt of the sum of the squared components, then multiply the components by the inverse sqrt.
- majewsky 8y agoThe point is that "inverse" usually refers to the function that reverses the effect of the original function, i.e. f_inv(f(x)) = x for all x in Domain(f) g(x) = 1 / sqrt(x) is not the inverse of f(x) = sqrt(x) in this sense.