Wikipedia:Reference desk/Archives/Mathematics/2020 June 4

From Wikipedia, the free encyclopedia
Mathematics desk
< June 3 << May | June | Jul >> Current desk >
Welcome to the Wikipedia Mathematics Reference Desk Archives
The page you are currently viewing is a transcluded archive page. While you can leave answers for any questions shown below, please ask new questions on one of the current reference desk pages.


June 4[edit]

In cubic interpolation, does the cubic curve pass through the outer points?[edit]

Image from 2016

Hello,

In diagrams I've seen e.g. http://researchgate.net/figure/Bi-cubic-spline-interpolation_fig1_280062913 , the cubic curves pass through all 4 points from which the cubic curve is derived, and that's what I've drawn in this diagram. I've come to realise that if that's the case, it's not possible to guarantee that the adjacent cubic curves have continuous derivative. This image also shows the curve passing through only the middle two points: http://paulinternet.nl/?page=bicubic . Is this interpretation correct?

Thanks,
cmɢʟeeτaʟκ 22:13, 4 June 2020 (UTC)[reply]

There are lots of different ways to do it. See for example Bézier curve. 2602:24A:DE47:BB20:50DE:F402:42A6:A17D (talk) 22:17, 4 June 2020 (UTC)[reply]
See also Cubic Hermite spline. -- ToE 00:43, 5 June 2020 (UTC)[reply]
There's an old technique which I call 'condition counting' which, while not 100% rigorous, is useful from a heuristic point of view. For a cubic polynomial there are four coefficients so you get to set four condition, and in four point interpolation you set the four conditions to be that the curve passes through the four points. For two adjacent curve you can set eight conditions, but an additional condition, namely that the derivatives match an the common point, would make 9, which is more than you're allowed. For Bezier and Hermite splines the four condition you set are the values and derivatives at the two endpoints. (For cubic curves, Bezier and Hermite splines are pretty much the same thing, just written in different ways.) So if you just have to pick the same derivatives at the endpoints to be the same and you're back down to the 8 conditions you're allowed. If you just specify that the derivatives are equal but not what they are, then you're down to 7 conditions and you need an additional condition to get a unique solution; the Hermite article gives some different choices for what this condition might be. --RDBury (talk) 03:46, 5 June 2020 (UTC)[reply]
Many thanks, RDBury, ToE and 2602:24A:DE47:BB20:50DE:F402:42A6:A17D. From Cubic_Hermite_spline#Catmull–Rom_spline, I see that a centripetal Catmull–Rom spline goes through all four points, if I understood it correctly. Good to know the diagram needn't be amended. Cheers, cmɢʟeeτaʟκ 11:42, 6 June 2020 (UTC)[reply]
To fit a piecewise cubic to a one-dimensional sequence, set the derivative at each sample to what it would be for the quadratic that fits it and the two adjacent points. Then you have for each interval four constraints: the two given points and their two derivatives. These define a cubic. (For the first and last intervals, one derivative is missing, so these intervals can be quadratic.) I imagine that an analogous approach works for a bicubic, but I have not tried it. —Tamfang (talk) 00:32, 7 June 2020 (UTC)[reply]
Thanks, Tamfang. cmɢʟeeτaʟκ 17:42, 7 June 2020 (UTC)[reply]
(continuing) The logic for this is that the curve for interval is defined by the values at , and the curve for interval is defined by the values at , so the properties of the curve at must be determined only by the intersection of these two sets of inputs. —Tamfang (talk) 00:47, 11 June 2020 (UTC)[reply]