Interpolation over an array (or two)

The other answers give you linear interpolations — these don’t really work for complex, nonlinear data. You want a spline fit, (spline interpolation) I believe.

Spline fits describe regions of the data using a set of control points from the data, then apply a polynomial interpolation between control points. More control points gives you a more accurate fit, less a more general fit. Splines are much more accurate than linear fits, faster to use than a general regression fit, better than a high-order polynomial because it won’t do crazy things between control points.

I can’t remember names off the top of my head, but there are some excellent fitting libraries in Java — I suggest you look for one rather than writing your own function.


**EDIT: Libraries that might be useful: **

** Theory/code that may be useful: **

  • Spline applets with code: link
  • Arkan spline fitting for poly-lines to bezier splines
  • Theory of splines, and some math for fitting. More math, less code, might help if the libraries don’t.

Leave a Comment