Some friends have seen some calculation formulas and theorems (such as Menelaus theorem, Ceva theorem, etc.) defined by the name of crooked nut boss. ), and I have to admit that me too. In the spirit of "soldier assault", if you don't abandon or give up, you must persist in gnawing even the most difficult bones! Therefore, this paper mainly introduces the basic concept of Bezier curve, application scenarios in Android and some thoughts. Regardless of the space, try to write the concept and understanding in detail.
Bessel curve, the naming rule, was probably invented by a mathematician named Bessel at first glance. However, the original mathematical formula on which Bezier curve is based is Bernstein polynomial, which was widely known in mathematics in 19 12. Simply understood, Bernstein polynomials can be used to prove that all continuous functions in the [a, b] interval can be approximated by polynomials and have strong convergence, that is, uniform convergence. Simply put, it is a continuous function. You can write it as the sum of several Bernstein polynomials. With n→∞, this polynomial will converge to the original function uniformly, which is the approximation property of Bernstein.
Time flies and the camera switches to 1959. Paul de Casteljau, a French mathematician who worked for Citroen at that time, began to make a graphical attempt on Bernstein polynomials and provided a numerically stable De castel Jou algorithm. According to this algorithm, a complex smooth curve can be generated with few control points, that is, Bezier curve.
However, the reputation of Bezier curve is so famous that we have to mention Pierre Pierre Bézier, a French engineer who worked in Renault 1962. He used this method to assist the industrial design of automobile body (the earliest computer was born to help the US Navy draw ballistic maps) and widely publicized it (a typical example of combining theory with practice and achieving success), so everyone called it Bezier curve.
Because the essence of Bezier curve is to draw a smooth curve through mathematical formula, it can be verified and explained by mathematical tools. Of course, it doesn't have to be verified by mathematics, because these great mathematicians have already done it. Here is just an explanation:
Maybe some friends still don't understand, so I'll take this GIF picture to explain it, as shown below:
P0, P 1 and P2 in the moving picture respectively represent the above picture: P0 = = A;; ; p 1 = = B; P2 = = C. Then this black dot represents point F and two endpoints of the green line segment (P0-P 1 the green dot on the line segment represents point D, and the green dot on the line segment P0-P2 represents point E). The acquisition of the point above the line segment must satisfy the proportional relationship.
The basic mathematical theory about Bezier curve is probably the above content. The Bezier curve in which two line segments find points according to the equal ratio relationship is also commonly known as the second-order Bezier curve.
As I said just now, the Bezier curve above is generally called the second-order Bezier curve. Since it is a second-order Bessel curve, there must be a third-order Bessel curve, a fourth-order Bessel curve and so on. In fact, the rules of third-order Bessel curve, fourth-order Bessel curve and n-order Bessel curve are all the same. First, find a point on the line segment, which must satisfy the proportional relationship, and then connect it in turn. The following is an explanation of the third-order Bezier curve:
The actions of the whole third-order Bezier curve add up to the following animation:
Then the realization steps of the fourth-order Bessel curve are the same. First, select five points (five points and four lines) on the plane, select points in turn (satisfying the proportional relationship), connect them in turn, and find out all points according to the calculation rules (one by one). . . . . .
It seems that they all start from the second-order Bezier curve. What about the first-order Bezier curve? The first-order Bezier curve is shown in the figure:
You can see that the first-order Bessel is a straight line! So N-order Bessel can draw not only smooth curves, but also straight lines, so there is an alternative method to draw straight lines with custom controls, but in general, Bessel is mainly used to draw curves, and only another solution is provided here; In addition, in the Android attribute animation, the system provides us with a pathfinder. There is a Bezier curve in this path interpolator. Interested friends can also learn about it.
To be continued. . .
If this article is helpful to your development or study, I hope you will leave a precious star, thank you.