Java Utililty Methods Lerp

List of utility methods to do Lerp

Description

The list of methods to do Lerp are organized into topic(s).

Method

floatlerp(float a, float b, float interpolation)
lerp
return a + interpolation * (b - a);
floatlerp(float a, float b, float t)
lerp
return a + (b - a) * t;
floatlerp(float fromValue, float toValue, float progress)
Linearly interpolates between fromValue to toValue on progress position.
return fromValue + (toValue - fromValue) * progress;
floatlerp(float origin, float target, int steps, int maxSteps)
lerp
return origin + (target - origin) * steps / maxSteps;
floatlerp(float start, float stop, float amt)
Calculates a number between two numbers at a specific increment.
return start + (stop - start) * amt;
floatlerp(float target, float current, float factor)
linear interpolate between target & current, factor is between 0 and 1.0
return target * factor + current * (1.0f - factor);
floatlerp(float to, float from, float f)
lerp
float ret = (to > from ? to - f : to + f);
if (withinThreshold(from, ret, 1))
    return from;
return ret;
floatlerp(float va, float vb, float t)
Linearly interpolates between va and vb by the parameter t.
return va + t * (vb - va);
floatlerp(float value1, float value2, float amount)
Interpolates between value1 and value2 by amount.
return value1 + (value2 - value1) * amount;
intlerp(int a, int b, float value)
lerp
return (int) (a + (b - a) * value);