Function to calculate distance between two coordinates Function to calculate distance between two coordinates javascript javascript