A quadratic Bézier curve is the path traced by the function B(t), given points P_0, P_1, and P_2.

Aryanna Fisher

Aryanna Fisher

Answered question

2022-11-19

Quadratic Bézier curve points
A quadratic Bézier curve is the path traced by the function B(t), given points P 0 , P 1 , and P 2 .
C ( t ) = i = 0 2 ( 2 i ) t i ( 1 t ) 2 i P i
C ( t ) = ( P 0 2 P 1 + P 2 ) t 2 + ( 2 P 0 + 2 P 1 ) t + P 0 t [ 0 , 1 ]
What exactly is P 0 or P 1 or P 2 concerning this equation?
Yes they are points. But in my understanding, a point is a pair of numbers (in 2D-space).
Let = ( 1 , 1 ), P 1 = ( 1 , 7 ) and P 2 = ( 7 , 1 ).
What values do you use (and where)?
How do you calculate the Bezier Curve for these points?

Answer & Explanation

lavarcar2d2

lavarcar2d2

Beginner2022-11-20Added 18 answers

Step 1
You can use standard operations on points in natural ways.
Adding (or subtracting) two points: P 1 + P 2 = ( x 1 + x 2 ,   y 1 + y 2 )
Multiplying (or dividing) a point by a number: P 1 k = ( x 1 k ,   y 1 k ).
The Bézier curve uses only the standard numerical operators and these two additional abilities.
Step 2
an example, using your data.
C ( t ) = ( P 0 2 P 1 + P 2 ) t 2 + ( 2 P 0 + 2 P 1 ) t + P 0 t [ 0 , 1 ]
C ( t ) = ( ( 1 , 1 ) 2 ( 1 , 7 ) + ( 7 , 1 ) ) t 2 + ( 2 ( 1 , 1 ) + 2 ( 1 , 7 ) ) t + ( 1 , 1 )
Applying multiplication:
C ( t ) = ( ( 1 , 1 ) ( 2 , 14 ) + ( 7 , 1 ) ) t 2 + ( ( 2 , 2 ) + ( 2 , 14 ) ) t + ( 1 , 1 )
And addition:
C ( t ) = ( 6 , 12 ) t 2 + ( 0 , 12 ) t + ( 1 , 1 )
then we can handle it by components by multiplying and adding some more:
C ( t ) = ( 6 t 2 + 1 , 12 t 2 + 12 t + 1 )
Usually you won't see it shown this way, though: The operations described above are considered already natural and straightforward.
pighead73283r

pighead73283r

Beginner2022-11-21Added 5 answers

Step 1
Generally, the formula should read (for your special case, the quadratic, m = 2 )
C ( t ) = i = 0 m ( m i ) P i ( 1 t ) i t m i
In a 2-dimensional environment, with control points ( x i y i ) i = { 0 , 1 , 2 } ,,
m = 2.
You would need TWO instances of the formula: one for each dimension. The first instance would utilize the x parts of your given control points in place of the Ps. The second instance would utilize the y parts. For each value of t, the two values yielded by these TWO instances would constitute the two coördinates for each point of your desired Bézier curve. Clear, I hope?
Step 2
For your example we need two coördinates for each of your given points. I have assigned each coördinate a name, as follows:
point x y P 0 P 0 , x P 0 , y P 1 P 1 , x P 1 , y P 2 P 2 , x P 2 , y
For each value of t, the corresponding point of your desired curve is ( x t y t ) , where
x t = P 0 , x ( 1 t ) 2 + 2 P 1 , x ( 1 t ) t + P 2 , x t 2
y t = P 0 , y ( 1 t ) 2 + 2 P 1 , y ( 1 t ) t + P 2 , y t 2

Do you have a similar question?

Recalculate according to your conditions!

Ask your question.
Get an expert answer.

Let our experts help you. Answer in as fast as 15 minutes.

Didn't find what you were looking for?