[Math] Length of bezier curve with Simpson’s rule

bezier-curvesimpsons rule

I wish to approximate the length of a Bézier curve in a 2D plane. I could do this iteratively – and may – but I want to experiment using Simpson's rule. I am not sure how to set this up and could use some advice. I am generating the Bézier curve from cubic parametric equations. Currently I am thinking

1) Divide Bézier curve using parameter

2) For each segment, derive quadratric fit equation using start, end and additional point on the curve, $ax^2+bx+c$

3) Here's where I need help – should I try to define the arc length function parametrically using $x(t)$ and $y(t)$, or as a function $f(x)$. Are the two cases equivalent in the 2D quadratic case – as $x(t)=t$ , and $y(t)=f(x)$?

Any advice or links appreciated!

Best Answer

This page gives the formula for arclength calculation. It covers the 3D case, but you can recover the 2D case just by ignoring $z$, of course. The formula involves an integral that can't be represented analytically. You can use any numerical integration technique you like, of course. The same page has a simple implementation of evaluation using Simpson's rule.

You should stick with the parametric form. Converting to $y = f(x)$ form is impossible, in general.

Related Question