Here you can find the source of linearInterp(long firstPoint, long lastPoint, int numValues, long currentPoint)
public static final double linearInterp(long firstPoint, long lastPoint, int numValues, long currentPoint)
//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 }