Minecraft wiki entry for Measuring_distance, associated text: Sometimes the need arises in which you need to measure distances that don't align with the X or Z axes, which is easy to do with a little algebra. The formula for Euclidean distance (in two dimensions), where d is the distance: