Distance between Two Locations on Earth (map_distance)

Calculate the distance between two locations on Earth. Get the distance in any unit you prefer, with an option to show the map.

Distance between Two Locations on Earth

Purpose

The "Distance between Two Locations on Earth" function calculates the distance between two locations on Earth based on the latitude and longitude coordinates provided by the user.

Use Cases

  • Planning a road trip and want to know the distance between two cities.
  • Calculating the distance between two points for hiking or biking routes.
  • Determining the distance between two locations for logistical purposes.

How to Use

  1. Enter the latitude and longitude coordinates for the starting location.
  2. Enter the latitude and longitude coordinates for the destination location.
  3. Optionally, you can provide the names of the locations for reference.
  4. Click on the "Calculate Distance" button to get the distance between the two locations.

Input Values

  1. From Latitude - Latitude of the starting location.
  2. From Longitude - Longitude of the starting location.
  3. To Latitude - Latitude of the destination location.
  4. To Longitude - Longitude of the destination location.
  5. From Location - Name of the starting location (optional).
  6. To Location - Name of the destination location (optional).

Output Values

  1. Distance - The calculated distance between the two locations in kilometers.
  2. From Location - Latitude and longitude of the starting location.
  3. To Location - Latitude and longitude of the destination location.

Any other Instruction

  • The default unit of measurement for distance is kilometers.
  • The function can also display a map showing the two locations and the calculated distance if the "Show Map" option is selected.

Code Analysis

The function uses the Haversine formula to calculate the distance between two points on the Earth's surface. It takes into account the curvature of the Earth to provide an accurate distance measurement.

Technical Parameters

method, from_latitude, from_longitude, to_latitude, to_longitude, from_location, to_location, show_map

Return Values

Distance, From Location, To Location

Example Expressions

You can use the following expressions to directly evaluate in a non-interactive manner using eva():

  1. Calculate distance between London and New York:
map_distance(from_location='London', to_location='New York')
  1. Calculate distance between Paris and Tokyo:
map_distance(from_location='Paris', to_location='Tokyo')

Click on Help icon to open the help page on a separate window.






Calculator: map_distance, Created by: super, V#0: , Variant owner: , Link