Details
Description
The attached patch is a first go at implementing the Interpolate function for numeric and colour interpolation. Please review it carefully as I expect many changes and improvements will be required. The patch also has a new version of the unit tests for the Categorize function but more work is required for them (and probably that function).
Some design issues:
The SE 1.1 spec defines two optional parameters for this function: method ("numeric" or "color") and mode ("linear", "cosine" or "cubic"). Surely these terms are the wrong way round ![]()
The cubic algorithm used was chosen for its simplicity and, hopefully, speed relative to more complex cubic spline algorithms, but I've only assessed its performance briefly and qualitatively.
The cubic algorithm requires at least 4 interpolation points. If less than 4 are provided the function falls back to cosine interpolation - is this reasonable ?
It is reasonable to downgrade to cosine when are three points are available; or to linear when two points are provided.