This is an algorithm that finds the distance between two points. Use the block definition in maths sprite.