Quake’s fast inverse square root
The inverse square root function (1/sqrt(x)) is used heavily during a game engine’s draw loop to normalize vectors into “unit” vectors with a length of 1. Normalized vectors are important because when you take the dot product of two of them (Ax*Bx + Ay*By + Az*Bz), the result is the cosine of the angle between […]