Java interpolate interpolateFloat(float t, float a, float b)

Here you can find the source of interpolateFloat(float t, float a, float b)

Description

Does a linear interpolation using doubles

License

Open Source License

Parameter

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

Return

an interpolated value between a and b (or beyond), with the relative position t.

Declaration

private static float interpolateFloat(float t, float a, float b) 

Method Source Code

//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);
    }
}

Related

  1. interpolateCubic(int x0, int x1, int x2, int x3, double t)
  2. interpolatedNoise(int x, int z, int reciprocal)
  3. interpolatedSample(double xStart, double xVal, double xEnd, double yStart, double yEnd)
  4. interpolatefinal(double a, final double b, final double d)
  5. interpolateFloat(float f0, float f1, double mixer)
  6. interpolateLinear(final float a, final float b, final float t)
  7. interpolateLinear(float lastState, float currentState, float ip)
  8. interpolateProp(final String source, final String propName, final String defValue)
  9. interpolateRotation(float par1, float par2, float par3)