Tag Archives: optimization

Optimization tip: don’t use sqrt when comparing distances

7 Jul

When comparing distances, whether it be for collision detection in games or drawing circles or discs (like in this recent Geeks3D post) I often see people using sqrt when they are comparing distances. This sqrt is not needed and only wastes CPU or GPU time.

Continue reading