]> granicus.if.org Git - graphviz/commitdiff
tclpathplan distance: rephrase an open coded 'hypot'
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sun, 6 Mar 2022 22:52:55 +0000 (14:52 -0800)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Wed, 9 Mar 2022 07:33:29 +0000 (23:33 -0800)
tclpkg/tclpathplan/tclpathplan.c

index 3eec7279a756b766584982f910069db78c46d466..479392f503bb39039185e72de2803a126d7f08fc 100644 (file)
@@ -283,7 +283,7 @@ static double distance(point p, point q)
 
     dx = p.x - q.x;
     dy = p.y - q.y;
-    return sqrt(dx * dx + dy * dy);
+    return hypot(dx, dy);
 }
 
 static point rotate(point c, point p, double alpha)