Here you can find the source of interpolateFloat(float t, float a, float b)
Parameter | Description |
---|---|
t | when 0, the result is a, when 1, the result is b. |
a | value at start of range |
b | value at end of range |
private static float interpolateFloat(float t, float a, float b)
//package com.java2s; //License from project: Open Source License public class Main { /**//from www . j a va 2 s. c o m * Does a linear interpolation using doubles * * @param t when 0, the result is a, when 1, the result is b. * @param a value at start of range * @param b value at end of range * * @return an interpolated value between a and b (or beyond), with the relative position t. */ private static float interpolateFloat(float t, float a, float b) { return a + t * (b - a); } }