Here you can find the source of LinearInterpolation(float a, float b, float f)
Parameter | Description |
---|---|
a | First value |
b | Second value |
f | Blend value |
public static float LinearInterpolation(float a, float b, float f)
//package com.java2s; //License from project: Open Source License public class Main { /**/*w w w .j a v a2 s. c o m*/ * Calculates linear interpolation between values * * @param a First value * @param b Second value * @param f Blend value * @return Interpolated value */ public static float LinearInterpolation(float a, float b, float f) { float possible = (a + b + f) / 3; if (Math.abs(possible) < 1) { return possible; } else { return 1; } } }