'Java math function like this math equation? [closed]
Is there any kind of Java math function like what this math equation does?
A_value = A_min + (B_value-B_min)/B_max*A_max
So it would be like this:
0 + (5-0)/10*5
That would be equal to 2.5. Is there any kind of math function like this? When B increases its value by a set minimum and maximum, A's value increases by a set minimum and maximum.
Solution 1:[1]
I think there is one!
public static double aValue(double aMin, double aMax, double bValue, double bMin, double bMax) {
return aMin + (bValue - bMin)/(aMax * bMax);
}
I'm not sure what you're talking about, actually, but I'm pretty sure Java doesn't have it. Here's the Java Math functions class
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | durron597 |
