If you're using och spatial reference where the distance is equal to sqrt((x1-x2)^2 + (y1-y2)), you could use that and some mouseEvents (like MouseEvent.MOUSE_MOVE and MapMouseEvent.MAP_CLICK) and event.stageX, event.stageY along with toMapFromStage.