Mathematical
A Bezier curve is a parametric equation about the points that represent a curve. We specify within the equation:
As the parameter t growth, we can get the point coordinates on any curve.
If the curve only have two control points, then this will be a straight line:
If the curve is quadratic, we will have three control points, whose derivative is first, and the second derivative is constant, which means that it can only have one kind of concavity and convexity, and the rate of change of curvature will not be too large:
If the curve is cubic, we will have four control points, the derivative of which is quadratic, and the second derivative is once, and its bumpiness may change, which is our most commonly used Bezier curve:
Implementation
By setting the points on the screen as control points and splitting the line segment into many straight line segments, we can easily draw Bezier curves.
You can drag any red control points to observe it.