See also: same question on Math.SE
How can I find the arclength of a Bezier curve? For example, a linear Bezier curve has the length:
length = sqrt(pow(x[1] - x[0], 2) + pow(y[1] - y[0], 2));
But what about quadratic, cubic, or n-degree Bezier curves?
(My goal was to estimate a sampling resolution beforehand, so I don't have to waste time checking if the next point is touching the previous point.)
Answer
A simple way for cubic Beziers is to split the curve into N segments and sum the segments' lengths.
However, as soon as you need the length of only part of the curve (e.g. up to a point 30% of the length along), arc-length parameterization will come into play. I posted a fairly long answer on one of my own questions about Béziers, with simple sample code.
No comments:
Post a Comment