3 ms·
You want one cubic polynomial segment? Or you want to figure out where to put variable knots to approximate your curve with a particular number of cubic segment
by jacobolus 9y ago
You want one cubic polynomial segment? Or you want to figure out where to put variable knots to approximate your curve with a particular number of cubic segments? Or ...
Try reading Raph Levien’s PhD thesis starting at page 135 http://www.levien.com/phd/thesis.pdf http://www.levien.com/phd/thesis.pdf
That is about converting a specific type of curve to cubic segments, but can give you an idea of the considerations involved.
- iTokio 9y agoIt’s a lossy compression issue: How to approximate a curve within a given error threshold with the minimum number of control points.
- jacobolus 9y agoWell the simplest one to code up is just bisection of segments until every one is under your error threshold. This is obviously far from ideal, but depending on your needs might be acceptable. If you are trying to approximate a function where the domain of the function is important then it’s fairly straightforward. See De Boor’s book A Practical Guide to Splines, which IIRC has a chapter or two about this. If instead you are using your spline to approximate the points of a curve without worrying about the parametrization, that gets trickier. Try doing a google scholar search (keywords along the lines of “spline variable knots cagd”), there are a pile of papers analyzing different approaches.
- iTokio 9y agoThe simple bissection can over fit quite easily. Thank you these are great resources!