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

index f94b2434392f4842d02478e8e2407115583247a3..1522aa1b287ddd7e8b88d44469707e7f3e32968a 100644 (file)
@@ -47,7 +47,7 @@ static void ideal_distance_avoid_overlap(int dim, SparseMatrix A, double *x, dou
       wx = width[i*dim]+width[jj*dim];
       wy = width[i*dim+1]+width[jj*dim+1];
       if (dx < MACHINEACC*wx && dy < MACHINEACC*wy){
-       ideal_distance[j] = sqrt(wx*wx+wy*wy);
+       ideal_distance[j] = hypot(wx, wy);
        *tmax = 2;
       } else {
        if (dx < MACHINEACC*wx){