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

doublelerp(double a, double b, double amt)
lerp
amt = clamp(amt, 1F, 0F);
return a * amt + b * (1D - amt);
doublelerp(double a, double b, double f)
Interpolates between point a and point b
return a + f * (b - a);
doublelerp(double a, double b, double lambda)
Perform a simple linear lerp between a and b
return a + lambda * (b - a);
doublelerp(double a, double l, double h)
Interpolates a value within a range.
return l + a * (h - l);
doublelerp(double amt, double start, double end)
lerp
if (amt <= 0.0D) {
    return start;
if (amt >= 1.0D) {
    return end;
return start + (end - start) * amt;
doublelerp(double distance, double firstPoint, double secondPoint)
One dimensional linear interpolation.
return firstPoint + distance * (secondPoint - firstPoint);
doublelerp(double from, double to, double p)
Linearly interpolates between two values.
assert p >= 0 && p <= 1 : "interpolation position out of range";
return from + (to - from) * p;
doublelerp(double from, double to, double progress)
Linearly Interpolate between 'from' and 'to' at 'progress' position.
return from + ((to - from) * progress);
doublelerp(double min, double max, double percentage)
lerp
return min + percentage * (max - min);
doublelerp(double min, double max, double val)
Linear interpolation
return (1.0 - val) * min + val * max;