Home > Blockchain >  How to subdivide Cubic Bezier curve into points
How to subdivide Cubic Bezier curve into points

Time:08-11

I am working with a dataset consisting of yearly data. Each item in the array corresponds to a year. I would to extend this dataset and make it monthly instead. I have been researching about it and trying different methods but in the end, finding De Casteljau’s algorithm to determine individual points at a Bezier curve.

Smooth and lost values

If you also inspect the values, within the original chart without subdivision, the value goes up to 1129, whereas in the subdivided one it is up to ~427.

Could you please help me - specifically what I am expecting from the algorithm is wrong or I am making a mistake somewhere? If you could point out if there are alternatives to this problem, that’d be great.

Thank you in advance.

CodePudding user response:

I found this library called Curve-Interpolator, enter image description here

CodePudding user response:

The De Casteljau’s algorithm is to be applied onto the control points, which in general do not lie on the curve. The point data used in your JS codes are points on the curve, which is not the same as control points for the curve. So, essentially, your 2nd curve is a Bezier curve with control points from points on the 1st curve. This is the reason why 2nd curve resembles the shape of the 1st curve but has a smaller peak value.

  • Related