'Subdivide lagrange interpolated curve
I'm looking for a way to subdivide a curve, generated by Lagrange interpolation.
Let's say I have a curve defined by c1,c2,c3 control points, and I want to divide it somewhere between c1 and c2 with d1 (d1 is a point that's on the curve between c1 and c2).
As a result I'm expecting 2 sets of control points, defining 2 curves that are equivalent (or very close) to the original curve. The picture below illustrates what I mean, the resulting 2 curves are moved apart for better visual representation only (dc1 and dc2 are newly created control points).
Is it possible to calculate the necessary control points for the 2 new lagrange curves with some formula, or the best I can do is to approximate? (I could interpolate the curve with short straight lines with a given precision, subdivide the created polyline at d1, and call it a day, but I'm hoping there is a formula for this, or at least a better algorithm than the one I'm suggesting here)
Clarification: I'm looking for a solution for 2D, like here: https://cindyjs.org/examples/25_Lagrange.html
Solution 1:[1]
Lagrange polynomial for three points is the only quadratic polynomial through these points.
So you can get any point inside left part and any point inside right part and recalculate two Lagrange polynomials - but they will be similar to each other and to initial polynomial.
I mean there is no sense in subdivision at all.
BTW, how are you going to use these curves?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 |