Learn R Programming

VTrack (version 1.10)

ComputeDistance: Compute the Distance Between Two Coordinates

Description

This function computes the distance between two geographical coordinates. These locations must be in decimal degrees.

Usage

ComputeDistance(Lat1, Lat2, Lon1, Lon2)

Arguments

Lat1
the latitude of the first coordinate
Lat2
the latitude of the second coordinate
Lon1
the longitude of the first coordinate
Lon2
the longitude of the second coordinate

Details

Coordinates are given in decimal degrees (WGS 84)

Examples

Run this code
# Calculate the distance between two coordinates
ComputeDistance(-12.19506,-12.19477,141.8946,141.8980)

Run the code above in your browser using DataLab