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

index 7857e2c9b37251d6df4fee94fda4a56e97112d0d..ac81eabd03056d904e8cce67bd00a962208c5b07 100644 (file)
@@ -436,7 +436,7 @@ static double dist(Ppoint_t p1, Ppoint_t p2)
     double dx, dy;
 
     dx = p2.x - p1.x, dy = p2.y - p1.y;
-    return sqrt(dx * dx + dy * dy);
+    return hypot(dx, dy);
 }
 
 static Ppoint_t scale(Ppoint_t p, double c)