getDistance method
Input objects