"Bruno Luong" <b.luong@fogale.findmycountry> wrote in message <kdccnj$kcc$1@newscl01ah.mathworks.com>...> "John D'Errico" <woodchips@rochester.rr.com> wrote in message <kdbk43$afl$1@newscl01ah.mathworks.com>...> > > > > pchip in 2-d as a tensor product form has been shown> > NOT to be adequate for the general desired behavior.> > (It sometimes will produce an acceptable result, but in> > general, it is not adequate.)> > > > John, I must admit that I don't know what is the adequate definition of shape preserving interpolation in 2D.> > I just though at least the tensorial product would preserve at least the monotonic in any cut parallel to the two axis. Unless I'm mistaken, this also implies that the interpolation within a patch will necessary be bounded by the four corner data, thus never overshoot.> > May be these characteristics are not enough for OP, but it is better than nothing. No?> > Bruno

Yes, monotonicity is not a trivial thing to discusswhen you move to more than one independentdimension.

It has been many years since I looked at it, but Irecall the statement that a simple tensor productversion of pchip is not adequate here. And I don'trecall under which circumstances that interpolantfails.

The case of a linear tensor product interpolant(often known as a bilinear interplant, as used byphotoshop) is a good one to study, as that mayoffer an idea. Consider the function f(x,y), whereit is defined at the 4 corners of the unit square,and we will use bilinear interpolation over thatdomain.

f((0,0) = 1f(0,1) = 0f(1,0) = 0f(1,1) = 1

Within the unit square, the tensor product linearinterpolant reduces to

f(x,y) = 1 - y - x + 2*x*y

which is clearly not linear. If we hold either x or yfixed, then of course it is again linear. But if weinterpolate along some other path, perhaps adiagonal one from corner to corner, then theinterpolant will be a quadratic polynomial withmin or max at the center of the square. This isthe classic problem with a tensor productinterpolant when applied in three dimensionsfor color science problems, and it is why thatmethod is avoided.

What I don't know (without some study) is if thetensor product pchip can still have non-monotonicbehavior parallel to an axis. (Perhaps tomorrowif I have some energy, as I think I know how toshow if this can happen.)