Here you can find the source of lerp(double a, double b, double f)
Parameter | Description |
---|---|
f | A percentage value between 0 to 1 |
public static double lerp(double a, double b, double f)
//package com.java2s; //License from project: Open Source License public class Main { /**//from www.j a v a 2s . c o m * Interpolates between point a and point b * * @param f A percentage value between 0 to 1 * @return The interpolated value */ public static double lerp(double a, double b, double f) { return a + f * (b - a); } public static float lerp(float a, float b, float f) { return a + f * (b - a); } }