calculating distances in space 5544877