5

I have about hundred points, that I want to approximate with Bezier curve, but if there are more than 25 points (or something like that), factorial counting in number of combination causes number overflow. Is there a way of approximating such amount of points in a Bezier-like way (smooth curve without passing through all points, except first and last)? Or do I need to choose another approximation algorithm with the same effect? I'm using default swing drawing tools.

P.S. English is not native for me, so probably I've used wrong math terms somewhere.

loginpassword
  • 307
  • 1
  • 5
  • 14

1 Answers1

6

Do you want to get one Bezier curve fitting best in all 100 points? If that is the case Jim Herold has a very detailed explanation how to do it. A further optimisation could be reducing the amount of points using the Douglas-Peucker algorithm.

mrab
  • 2,702
  • 1
  • 17
  • 10
  • I'm having a little bit of an issue with the approach by Jim Herold. He picks t values by assuming they are spaced the same way as in the given set of points. That will result in _a_ fit, but I don't think it's the best fit. Maybe this could be turned into an iterative algorithm, where with every approximation, the best t_i-values are found to then create the next approximation. – Ant6n Oct 15 '16 at 19:17