- xrspatial.proximity.euclidean_distance(x1: float, x2: float, y1: float, y2: float) float #
Calculates Euclidean (straight line) distance between (x1, y1) and (x2, y2).
x1 (float) – x-coordinate of the first point.
x2 (float) – x-coordinate of the second point.
y1 (float) – y-coordinate of the first point.
y2 (float) – y-coordinate of the second point.
distance – Euclidean distance between two points.
- Return type
>>> # Imports >>> from xrspatial import euclidean_distance >>> point_a = (142.32, 23.23) >>> point_b = (312.54, 432.01) >>> # Calculate Euclidean Distance >>> dist = euclidean_distance( ... point_a, ... point_b, ... point_a, ... point_b) >>> print(dist) 442.80462599209596