Here you can find the source of lerp(double x, double x1, double x2, double q00, double q01)
private static double lerp(double x, double x1, double x2, double q00, double q01)
//package com.java2s; //License from project: Open Source License public class Main { private static double lerp(double x, double x1, double x2, double q00, double q01) { return ((x2 - x) / (x2 - x1)) * q00 + ((x - x1) / (x2 - x1)) * q01; }/*from ww w.j a va2s. c o m*/ }