Here you can find the source of interpolate(float a, float b, float d)
Parameter | Description |
---|---|
a | The first value |
b | The second value |
d | The interpolation factor, between 0 and 1 |
public static float interpolate(float a, float b, float d)
//package com.java2s; //License from project: LGPL public class Main { /**// w w w. j av a 2 s. co m * @param a The first value * @param b The second value * @param d The interpolation factor, between 0 and 1 * @return a+(b-a)*d */ public static float interpolate(float a, float b, float d) { return a + (b - a) * d; } /** * @param a The first value * @param b The second value * @param d The interpolation factor, between 0 and 1 * @return a+(b-a)*d */ public static double interpolate(double a, double b, double d) { return a + (b - a) * d; } }