This article mainly introduces the use of canvas to draw the Bezier curve, including the 2 and 3 Vansel curves. It is very detailed, so I recommend a friend. 1. Quadratic Bezier curve
quadraticCurveTo(cpx,cpy,x,y) //cpx, cpy represents the coordinates of the control point, x,y represents the coordinates of the end point;
The mathematical formula is expressed as follows:
The path of the quadratic Batez curve is tracked by the function B(t) given points P0, P1, and P2:
Code example:
Copy the code