Java Linear Interpolate linearInterpolate(float y1, float y2, float mu)

Here you can find the source of linearInterpolate(float y1, float y2, float mu)

Description

interpolates linear between two values

License

Open Source License

Parameter

Parameter Description
y1 is the first value
y2 is the second value
mu is a value between 0 and 1

Return

interpolated value

Declaration

public static float linearInterpolate(float y1, float y2, float mu) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    /**//from   w ww .j a  v a  2 s .  c  o  m
     * interpolates linear between two values
     * 
     * @param y1
     *            is the first value
     * @param y2
     *            is the second value
     * @param mu
     *            is a value between 0 and 1
     * @return interpolated value
     * 
     * @see http://local.wasp.uwa.edu.au/~pbourke/other/interpolation/
     */
    public static float linearInterpolate(float y1, float y2, float mu) {
        return (y1 * (1 - mu) + y2 * mu);
    }
}

Related

  1. linearInterp(double xa, double ya, double xb, double yb, double x)
  2. linearInterp(long firstPoint, long lastPoint, int numValues, long currentPoint)
  3. linearInterpolate(double v0, double v1, double t)
  4. linearInterpolate(double v1, double v2, double amount)
  5. linearInterpolate(double[] x)
  6. linearInterpolation(double min, double max, double factor)
  7. linearInterpolation(double x, double x1, double x2, double y1, double y2)
  8. linearInterpolation(double x0, double y0, double x1, double y1, double x)
  9. linearInterpolation(double y2, double y1, double deltaX, double x1)