normalize method
Normalizes num
such that num2
would obtain the value
normalizedNum2
. Returns the respective new value for num
.
If normalizedNum2
is null, num
is returned.
Implementation
static double normalize(double num, double num2, double normalizedNum2) {
double normalizedY = num;
if (normalizedNum2 != null && num2 != null && num2.abs() > 0.00000001) {
normalizedY = (num * normalizedNum2) / num2;
}
return normalizedY;
}