Here you can find the source of linearInterpolation(double min, double max, double factor)
public static double linearInterpolation(double min, double max, double factor)
//package com.java2s; //License from project: Open Source License public class Main { public static double linearInterpolation(double min, double max, double factor) { double cappedFactor = cap(factor, 0.0, 1.0); return min + (max - min) * cappedFactor; }//from w ww.j ava 2 s . c om public static double cap(double value, double min, double max) { return Math.max(min, Math.min(value, max)); } }