News for hackers. Stuff that matters.
Re:Category Theory in Programming by prakashrj on Sunday December 01, 2024 @11:01PM (#42292990)
Is Bézier curves not enough to fit curve to points? Just checking as I am very curious about this problem.
Re:Category Theory in Programming by epgui on Monday December 02, 2024 @12:09AM (#42293307)
The answer is obviously no, but I’m not the right person to explain (biochemist).

For some reason you were downvoted down to oblivion, and I think that was unfair.

Re:Category Theory in Programming by roenxi on Monday December 02, 2024 @02:25AM (#42293893)
Bézier curves parameterise a curve with points. When people talk about "fitting a curve" I would expect they mean fitting a model rather than that the curve is fully determined by the points. Typically people fit linear or low-order polynomials, it'd be a weird day where someone wanted to use a Bézier for their model - those curves weren't designed for being statistically tractable or interesting.

See https://en.wikipedia.org/wiki/Curve_fitting

Re:Category Theory in Programming by HappMacDonald on Monday December 02, 2024 @03:39AM (#42294308)
To expand upon roenxi's answer: Bezier curves are an example of creating a cubic (degree 3) parametric polynomial curve by using four points to describe where you want it to go.

Curve fitting is about starting with a cloud of points, and trying to decide how to draw a polynomial (of whatever degree you want) that does a good job of describing the trend line of those points.

Then you can use that polynomial to approximately interpolate points between the samples, or extrapolate points beyond the samples as an example.

Re:Category Theory in Programming by liontwist on Monday December 02, 2024 @10:03AM (#42296868)
No. Here are two common and practical kinds of curve fitting:

1. Least squared polynomial fit.

This finds a curve that approximates a set of (x, y) pairs.

2. Polynomial interpolation

This makes a polynomial which goes exactly through the given points.