List of utility methods to do Lerp
double | lerp(double start, double distance, double factor) lerp return start + (distance * factor);
|
double | lerp(double v1, double v2, double amt) lerp return v1 + (v2 - v1) * amt;
|
double | lerp(double x, double x1, double x2, double q00, double q01) lerp return ((x2 - x) / (x2 - x1)) * q00 + ((x - x1) / (x2 - x1)) * q01;
|
double | lerp(double x, double x1, double x2, double q00, double q01) Linear interpolation. return ((x2 - x) / (x2 - x1)) * q00 + ((x - x1) / (x2 - x1)) * q01;
|
double | lerp(final double a, final double min, final double max) lerp return min + a * (max - min);
|
int | lerp(final double percent, final int startColor, final int endColor) lerp if (startColor == endColor) { return startColor; } else if (percent <= 0.0) { return startColor; } else if (percent >= 1.0) { return endColor; final int r = (int) ((1.0 - percent) * (startColor >> 24 & 0xFF) + percent * (endColor >> 24 & 0xFF)); ... |
float | lerp(final float a, final float b, final float f) With this function you can find the value that equates to the position between two other values for a given percentage. return a * (1.0f - f) + b * f;
|
float | lerp(final float percent, final float startValue, final float endValue) lerp if (startValue == endValue) { return startValue; return (1 - percent) * startValue + percent * endValue; |
float | lerp(final float x, final float x1, final float x2, final float q00, final float q01) lerp return (x2 - x) / (x2 - x1) * q00 + (x - x1) / (x2 - x1) * q01;
|
float | lerp(float a, float b, float f) Linearly interpolates between two floats return a + f * (b - a);
|