Professional Documents
Culture Documents
P(t ) =(1 − t )2 P0 + 2t (1 − t ) P1 + t 2 P2
Equation of cubic Bezier curve
P(t ) =(1 − t )3 P0 + 3t (1 − t )2 P1 + 3t 2 (1 − t ) P2 + t 3 P3
Example 1:
A sample program ParametricBezierCurve.java is given to you that draws a linear Bezier curve (parametric
line) as shown below. Compile and run this program.
Exercise 1
Complete the code of quadraticBezier(…) and cubicBezier(…) methods in the example program such that the
program also draws quadratic and cubic Bezier curves as shown below.
• Math.pow(a, b);
• Example
o Math.pow(2, 4) mean 2 to the power 4, i.e., 24 = 16