Calculates the Euclidean distance between two points in 2D space.
Arguments
- p1
A numeric vector of length 2 representing the first point (x, y).
- p2
A numeric vector of length 2 representing the second point (x, y).
Value
A numeric value representing the Euclidean distance between the two points.
Examples
# Example usage:
point1 <- c(0, 0)
point2 <- c(3, 4)
distance <- ild(point1, point2)
print(distance) # Should be 5
#> [1] 5