Here you can find the source of lerp(double min, double max, double val)
public static double lerp(double min, double max, double val)
//package com.java2s; //License from project: LGPL public class Main { /** Linear interpolation */ public static double lerp(double min, double max, double val) { return (1.0 - val) * min + val * max; }/*from w w w . ja v a2 s. c om*/ /** Linear interpolation */ public static int lerp(int min, int max, double val) { return Long.valueOf(Math.round((1.0 - val) * min + val * max)).intValue(); } }