euclidean | R Documentation |
This function calculates the Euclidean distance between two points. The Euclidean is the 'straight line' distance between two points in a two-dimensional space. This function takes the coordinates of two points (longitude and latitude) and calculates the straight distance between them, assuming flat Earth approximation.
euclidean(x1, y1, x2, y2)
x1 |
X-coordinate of the first point. |
y1 |
Y-coordinate of the first point. |
x2 |
X-coordinate of the second point. |
y2 |
Y-coordinate of the second point. |
The Euclidean distance between the two points.
euclidean(1, 2, 4, 6)
# Euclidean distance between points (1, 2) and (4, 6).
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.