Click on the green flag and as you move the mouse-pointer around the screen, the distance formula for the Cartesian plane from analytic geometry is used to compute the distance between the ant and the mouse=pointer. In my project One Blind Mouse (http://scratch.mit.edu/projects/359914/), I use the distance formula to simulate the motion of a blind mouse that can smell (but not see) a piece of cheese. As the distance between the blind mouse and the cheese decreases, the smell gets stronger. As the distance increases, the smell gets weaker. The strategy of the blind mouse is to move to make the smell stronger.
See inside and note that the distance formula for the Cartesian plane, D = √(x2–x1)^2 + (y2–y1)^2, is the only computational step in the code.