Skip to content

Commit 1d71304

Browse files
committed
Make regular distance use hypot
1 parent f3dba87 commit 1d71304

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/methods/distance.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ end
192192

193193
# Returns the Euclidean distance between two points.
194194
Base.@propagate_inbounds _euclid_distance(::Type{T}, p1, p2) where T =
195-
sqrt(_squared_euclid_distance(T, p1, p2))
195+
hypot(T(GI.x(p2)) - T(GI.x(p1)), T(GI.y(p2)) - T(GI.y(p1)))
196196

197197
# Returns the square of the euclidean distance between two points
198198
Base.@propagate_inbounds _squared_euclid_distance(::Type{T}, p1, p2) where T =

0 commit comments

Comments
 (0)