calculate distance from mouse to targets