Here you can find the source of interpolate(double x1, double x2, double inbetween)
public static double interpolate(double x1, double x2, double inbetween)
//package com.java2s; public class Main { public static double interpolate(double x1, double x2, double inbetween) { return x1 + (x2 - x1) * inbetween; }/*from w w w .j a v a 2 s.c o m*/ public static float interpolate(float x1, float x2, float inbetween) { return x1 + (x2 - x1) * inbetween; } public static int interpolate(int x1, int x2, double inbetween) { return (int) (x1 + (x2 - x1) * inbetween); } }