## CPSC 170 Post Lab 6

Bézier Curves

Due Before Class on Friday, February 19^{th}

A Bézier curve is a method for representing curves popularized by the French engineer designer Pierre Bézier in the 1960's. Bézier used the curves in the design automobiles. The curves are still popular today in drawing and animation applications because they offer an intuitive control over curve shape. Bézier curves can also be approximated very easily using a recursive algorithm developed another Frenchman, Paul de Casteljau. You are going to create a program that allows users to draw a Bézier curve.

### Details

Create a program that allows the user to click in the window to add Bézier curve control points. Each time the user clicks the program should add the new point to the list of control points that have already been clicked and then draw the Bézier curve that is represented by all of the control points. To do this you should create two methods. One method that uses a loop to find the specified number of evenly spaced points on the Bézier curve defined by the array of control points. A second, recursive method, that implements de Casteljau's algorithm. This method is called by the first method to find a point on the Bézier curve given its parametric distance from the beginning of the curve. Once you have calculated all of the points that approximate the curve draw the approximation by drawing lines in between consecutive points.

**Submission**: Tar and submit your code on the course blackboard site.