Here you can find the source of interpolateCubic(int x0, int x1, int x2, int x3, double t)
private static int interpolateCubic(int x0, int x1, int x2, int x3, double t)
//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*/ }