1. Intention
This blog post goes through all the math behind fitting a one-dimensional cubic Bezier curve to a data set, using the least squares regression method.
There are multiple implementation of this algorithm in MathLab, Python, C++, etc… but ...