I'm smoothing a path via cubic interpolation, based on [this math](http://paulbourke.net/miscellaneous/interpolation):

```
mu2 = mu*mu;
a0 = -0.5*x0 + 1.5*x1 - 1.5*x2 + 0.5*x3;
a1 = x0 - 2.5*x1 + 2*x2 - 0.5*x3;
a2 = -0.5*x0 + 0.5*x2;
a3 = x1;

interpolated_x = (a0*mu*mu2+a1*mu2+a2*mu+a3)

```

When I try to trace a segment on the path by iterating `mu` from 0.0 to 1.0, the distances are not equal. In the screenshot, the red points are the points of the path, the green and blue points are control points to calculate the curve.

[![enter image description here](https://i.stack.imgur.com/CU7t8.jpg)](https://i.stack.imgur.com/CU7t8.jpg)

Is there a way I can calculate a percentage of distance covered of a segment that gives me equal distances?

(I want to calculate a movement on this path, that has the same speed and depends on the percentage of distance covered. In this way, the movement would be faster in the middle of each segments.)