Java interpolate interpolateCubic(int x0, int x1, int x2, int x3, double t)

Here you can find the source of interpolateCubic(int x0, int x1, int x2, int x3, double t)

Description

interpolate Cubic

License

Open Source License

Declaration

private static int interpolateCubic(int x0, int x1, int x2, int x3, double t) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    private static int interpolateCubic(int x0, int x1, int x2, int x3, double t) {
        int a0 = x3 - x2 - x0 + x1;
        int a1 = x0 - x1 - a0;
        int a2 = x2 - x0;
        return (int) Math.max(0, Math.min(255, (a0 * (t * t * t)) + (a1 * (t * t)) + (a2 * t) + (x1)));
    }/*from   w  ww.  ja v  a2 s . com*/
}

Related

  1. interpolateColor(int a, int b, float w)
  2. interpolateColor(int c1, int c2, int st, int sts)
  3. interpolateColor(int rgba1, int rgba2, float percent)
  4. interpolateColors(int a, int b, float lerp)
  5. interpolateColors(int c0, int c1, float w)
  6. interpolatedNoise(int x, int z, int reciprocal)
  7. interpolatedSample(double xStart, double xVal, double xEnd, double yStart, double yEnd)
  8. interpolatefinal(double a, final double b, final double d)
  9. interpolateFloat(float f0, float f1, double mixer)