I now every equation of bezier curve like the linear Bezier curve, quadratic bezier curve, cubic bezier curve, and also the advanced bezier curve so please dont explain.

I mean normally people would say, ah okey that a function I need to use everytime. But I want understand deeply what this function does.

Again: â€śWe are then taking the two pointsâ€¦â€ť what the hell??? where the two points created by wich one? I didnt understand the whole sentence??

I donâ€™t know anything about Bezier curves either but I think I understand what is being said here.

Essentially: youâ€™re creating three points anywhere, so where theyâ€™re created is on you. Point 0 is your start point, Point 2 is your end point and I suppose Point 1 determines the intensity of the curve. The gray lines are there to show how lerp is applied in creating the curve and why you need three points.

When it comes to the lerp functionâ€™s involvement here, youâ€™re lerping across two lines: Point 0 â†’ Point 1 and Point 1 â†’ Point 2. Your t value (the alpha between a and b in the lerp) is used in both because what youâ€™re effectively doing is inversely between both lines in order to create the curve: up on P0-P1 and down on P1-P2. Youâ€™ll see the curve being created as more points are created along each line.

The third lerp creates a line between the two points from the earlier two lerps which gets a point on the curve. So all in all, youâ€™re just creating many lines and getting points on them to create a curve all while using the same alpha value: up on P0-P1, down on P1-P2 and across after joining the lines.

Does this help you make a bit more sense out of the explanation orâ€¦?

I understood what the function quadBezier does but I didnt understood what the lerp function does. I mean, I understood it a bit better but could you just go on with the lerp. what is â€ś(b-a)â€ť do? why coudnt I write a - b. I think we write a + (b-a) because of the next points.

Oh, I think I get you. Is it specifically the math of the lerp function thatâ€™s confusing you? First thing I should mention is that lerp is short for linear interpolation.

Think of lerping as trying to get a percentage between two points. You have three variables:

a represents your first value, a minimum

b represents your second value, a maximum

c is a decimal value typically in the range [0, 1]

c is basically meant to be a percentage between these two values. a is returned when c is 0, b is returned when c is 1 and the middle value between a and b is returned when c is 0.5; therefore, c helps you find midpoints between your minimum and maximum.

The math here is that youâ€™re offsetting a by a certain value, which is the remaining value required for a to reach b. For 50 to reach 100, we need 50 more value, which is where the (b - a) part comes from (100 - 50 = 50). The c value helps adjust the remaining value like a percentage: say our c value is at 0.5 (weâ€™re lerping 50% between 50 and 100). The remaining value needed is 50. 50% of 50 is 25 (50 * 0.5 = 25). This is added to a and then returned (50 + 25 = 75). So weâ€™re 50% between 50 and 100 which is 75.