Issue
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
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
Answered By - durron597
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.