working distance calculations between different points