lerp

quadratic bezier
add another point to the above example say P2 and lerp another point say Q on the new line segment, joining those lerping points, we get the blue line segment above, add a lerp on the blue segment, (all having the same t value), we get the point creating a quadratic bezier.
cubic bezier


another way of math

This can also be visualized as a weighted sum of vectors of all points.
the individual weights are a cubic function of t (here).
- derivatie of a bezier curve is another bezier curve, but one degree lower.
- the length of curve cannot be calculated directly, it is an elliptical integral (no closed form solution.
- only way is to approximate it with line segments.
- but there is another thing to keep in mind that equally spaced t values do not correspond to equally distant points.
equally spaced t values.
this can be used actually because where the points are far apart, there is less curvature, so approximating with a line is fine.
equally spaced points
generate a lookup table and from there, find the t value corresponding to the equally spaced distances on y axis