Implementation of distance calculation from an arbitrary point to the given destination.