Java Linear Interpolate linearInterp(long firstPoint, long lastPoint, int numValues, long currentPoint)

Here you can find the source of linearInterp(long firstPoint, long lastPoint, int numValues, long currentPoint)

Description

linear Interp

License

Open Source License

Declaration

public static final double linearInterp(long firstPoint, long lastPoint, int numValues, long currentPoint) 

Method Source Code

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

public class Main {
    public static final double linearInterp(long firstPoint, long lastPoint, int numValues, long currentPoint) {
        return (currentPoint - firstPoint) / (double) (lastPoint - firstPoint) * (numValues - 1);
    }//from w w w. ja v  a2s  . c om
}

Related

  1. LinearInterp(double n0, double n1, double a)
  2. linearInterp(double xa, double ya, double xb, double yb, double x)
  3. linearInterpolate(double v0, double v1, double t)
  4. linearInterpolate(double v1, double v2, double amount)
  5. linearInterpolate(double[] x)
  6. linearInterpolate(float y1, float y2, float mu)