On 22 March 2010 21:57, Andrea Aime wrote: > Maybe by adding missing points outside of the specified range > to make the cubic algorithm work? > By the way I read the spec we can imagine repeating the first > and the last point indefinitely below and above what was > specified without really changing the outcome? > So I guess we could add one copy of the first point below > the first point and one copy of the last point above the > last point just to handle the corner case of X falling > in the area we cannot cover with the given points. > Wondering, would doubling the point in place work? > Like, we assume the first point is there two times in > the expression? And same for the last? > Would that provide a continuous output?
Here's a test I did with the cubic algorithm... http://imagebin.org/89895 The first and last points are added such that they like outside the range of the "real" interpolation points but have the same y-value as their neighbour. For the cubic algorithm it is actually a requirement that no points have tied x values - I'll have to add a check for that to the function. So there could be this scheme: N points Algorithm 0 any throw an Exception 1 any evaluate point's value and return for all inputs >=2 lin / cos ok 2 cubic fall back to linear (since 4 collinear points would give ~linear results) 3 cubic add dummy point before or after to put lookup value into middle interpolation interval >=4 cubic ok Plus, for 2 or more points, treat lookup values outside the range of the points as per the spec. What do you think ? Michael ------------------------------------------------------------------------------ Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev _______________________________________________ Geotools-devel mailing list Geotools-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-devel