List of utility methods to do interpolate
double | interpolate(double a, double b, double d) interpolate return a + (b - a) * d;
|
double | interpolate(double fromAngle, double toAngle, double ratio) Interpolates angle according to rate, with correct 0->360 and 360->0 transitions double delta = toAngle - fromAngle; if (Math.abs(delta) > 180) { toAngle += delta > 0 ? -360 : 360; return normalize(fromAngle + ratio * (toAngle - fromAngle)); |
double | interpolate(double oldP, double newP, float partialTicks) interpolate if (oldP == newP) { return oldP; return oldP + ((newP - oldP) * partialTicks); |
double | interpolate(double p0, double p1, double p2, double p3, double t) Interpolation of Catmull-Rom Spline double v0 = (p2 - p0) * 0.5; double v1 = (p3 - p1) * 0.5; double t2 = t * t; double t3 = t * t2; return (2.0 * p1 - 2.0 * p2 + v0 + v1) * t3 + (-3.0 * p1 + 3.0 * p2 - 2.0 * v0 - v1) * t2 + v0 * t + p1; |
double | interpolate(double x, double x1, double y1, double x2, double y2) Interpolate a value between two points. double alpha = (x - x1) / (x2 - x1); return y1 * (1 - alpha) + y2 * alpha; |
double | interpolate(double x1, double x2, double inbetween) interpolate return x1 + (x2 - x1) * inbetween;
|
double | interpolate(double x1, double x2, float zeroToOne) interpolate if (zeroToOne == 1.0f) return x2; return x1 + zeroToOne * (x2 - x1); |
double | interpolate(final double min, final double max, final int currentClass, final int numOfClasses) interpolate return min + (currentClass * (max - min) / (numOfClasses - 1));
|
float | interpolate(final float prev, final float curr, final float alpha) interpolate return (prev * (1 - alpha)) + (curr * alpha);
|
int | interpolate(final int n, final int lastN, final float interpolation) interpolate return Math.round(((n - lastN) * interpolation + lastN));
|