Recursive Estimate of Cubic Bezier Curve Arc Length

I used the below illustration to write a recursive estimation of the arc length of a cubic bezier curve.  The illustration shows how a bezier curve can be split and the new control points determined.  A p5.js sketch is below.  You can view the source code.



The curve is split at point 1234, creating a left side curve (1 -> 1234 )  and a right side bezier curve (1234 -> 4) .  The new control points are taken at the mid point of an original control point and anchor, and then at the mid point of the line defined by pt 12 -> 23, or 23 -> 34.  It is very elegant.  This method of splitting the curve can then be applied recursively, continually splitting the curve in half, until you have lots of very small curves that are essentially straight lines of a small length.