You could use some form of interpolating polynomial, e.g. Lagrange interpolation or Newtonian interpolation. You have a function described by the values in your array [0, 0.2, 0.3, ..., 2.5]. You can then use one of the interpolation methods to basically map the indexes of your array [0, 1, 2, ..., N] to the values. See Lagrange polynomial and Newton polynomial for details. Be aware that using these to interpolate values outside the defined range of the function can be problematic, and that linear interpolation may provide better results if your values are, in fact, linear.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…