Here you can find the source of lerp(float va, float vb, float t)
Parameter | Description |
---|---|
va | first value. |
vb | second value. |
t | parameter. |
public static float lerp(float va, float vb, float t)
//package com.java2s; /**// w w w.j a v a2s . com * This file is part of Kowy Engine. * * Kowy Engine is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * Kowy Engine is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Kowy Engine. If not, see <http://www.gnu.org/licenses/gpl-3.0.txt>. */ public class Main { /** * Linearly interpolates between va and vb by the parameter t. * * @param va * first value. * @param vb * second value. * @param t * parameter. * @return result value. */ public static float lerp(float va, float vb, float t) { return va + t * (vb - va); } }