As an aspiring code farmer, in addition to knowing some basic knowledge enough to move bricks, but also should get some more cool skills, with a more elegant posture to move bricks; To achieve something really cool, Bessel curves need to be studied a little bit; Recently, I have been doing some research on Bezier curves, so I decided to write a series of articles on bezier curves to document my research.

I know the rules! # #

I know, you have to do this first, otherwise you’re not going to be interested in looking at the first and second order applications of bezier curves, which are relatively simple





Look at the bezier curve of the second order does not feel familiar, yes,360 down rocket when the slingshot, and sliding control of the shadow prompt; In the past, many friends told me that it was impossible to calculate how much data, but now with bezier curve, it is very easy to achieve this function;








But you can’t do that at all, there’s a little bit more complicated curve going on and yes, this is the use of the third order, does it feel like it’s a little bit more complicated, but fortunately, it’s totally easy to do with a Bessel; By the way, there is also a heart moving along the curve. When you see this, you will surely think of a scene full of hearts flying on the screen. Rest assured, I have achieved this, and I will explain it one by one in the next article





 ##图片看完了,现在简单了解贝塞尔曲线 ##

Bezier curves are mathematical curves used in two-dimensional graphics applications. Curve definition: starting point, ending point (also known as anchor point), control point. By adjusting the control points, the shape of the Bezier curve changes. In 1962, French mathematician Pierre Bezier was the first to study this vector curve drawing method, and gave a detailed calculation formula, so the curve drawn according to such a formula is named after his family name, called Bezier curve. In the following formula: B(t) is the coordinate of the point at t time; P0 is the starting point,Pn is the ending point, and Pi is the first-order Bezier curve (line segment) of the control point:





Description: A parabola describing a line segment of a second-order Bessel curve from the continuous point P0 to P1:





Principle: describe a line segment from P0 to P1 continuous point Q0. The continuous point Q1 from P1 to P2 describes a line segment. Describe a quadratic Bessel curve from the continuous point B(t) Q0 to Q1. Rule of thumb: P1-P0 is the tangent line of the curve at P0.

Third-order Bezier curve:





General formula:





We can draw a lot of cool curves using these properties of bezier curves, so bezier curves are worth studying; ## But I can’t remember any of this!! ## Never mind, can be very responsible to say, I am also!!!!! The above curve entirely from [the] blog.csdn.net/tianhai110/… So, if your math was taught by a PE teacher like me, forget that,and let’s look at the implementation of a Bezier curve in Android. Android has already done it for us,and the rest is up for us to use

The most complete Bezier curve solution (2): Simple drawing of curves in Android]

[History of the most complete Bezier curve (Bezier) full solution (three): Bezier curve to achieve full screen love]

In the final attached source code :github.com/sangxiaonia…