Calculating the Distance Between Two Points in 1D, 2D and 3DFinding the distance between two points is a trivial task in any programming language yet, has a wide range of uses. Some examples include if you would like to check if you are near to a powerup, find the precise distance between you and a checkpoint or even finding out which player an enemy is nearest to for a simple targeting system. In the following examples I will be using pseudo code as well as working C code.
Next lesson (Finding Distance in 3D)
Back to index