Merge "Don't use pow for distance calculation" into sc-dev

This commit is contained in:
James O'Leary
2021-04-29 15:55:49 +00:00
committed by Android (Google) Code Review

View File

@@ -62,6 +62,6 @@ public class LABCentroid implements CentroidProvider {
double dL = a[0] - b[0];
double dA = a[1] - b[1];
double dB = a[2] - b[2];
return (float) (Math.pow(dL, 2) + Math.pow(dA, 2) + Math.pow(dB, 2));
return (float) (dL * dL + dA * dA + dB * dB);
}
}