From: Matthew Fernandez Date: Sun, 6 Mar 2022 22:56:01 +0000 (-0800) Subject: libmingle force_directed_edge_bundling: rephrase an open coded 'hypot' X-Git-Tag: 4.0.0~185^2~10 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=84bab6c49cd5a13c2e5c14fb75d2207e16f33ec0;p=graphviz libmingle force_directed_edge_bundling: rephrase an open coded 'hypot' --- diff --git a/lib/mingle/edge_bundling.cpp b/lib/mingle/edge_bundling.cpp index 098e810bd..fe3b9b3ca 100644 --- a/lib/mingle/edge_bundling.cpp +++ b/lib/mingle/edge_bundling.cpp @@ -482,7 +482,9 @@ static pedge* force_directed_edge_bundling(SparseMatrix A, pedge* edges, int max for (j = 1; j <= np - 2; j++){ for (k = 0; k < dim; k++) { - x[j*dim + k] += step*edge_length*(force_t[j*dim+k] + K*force_a[j*dim+k])/(sqrt(fnorm_t*fnorm_t + K*K*fnorm_a*fnorm_a)); + x[j * dim + k] += step * edge_length + * (force_t[j * dim + k] + K * force_a[j * dim+k]) + / hypot(fnorm_t, K * fnorm_a); } }