CPSC 170 Sub Post Lab 6
De Casteljau
Due Before Class on Friday, February 24th

The post lab 6 assignment involves an extension the the drawing program from post-lab 2 to add the ability to draw curves. In order to draw curves, points on the curve must be calculated. The de Casteljau algorithm can be used to find any point on a Bezier curve. So, for this sub-post-lab assignment you will implement the de Cateljau algorithm recurisvely using the definition:

dC(⟨p1⟩, t) = p1
dC(⟨p1, p2, … pn⟩, t) = dC(⟨interp(p1, p2, t), interp(p2, p3, t), … interp(pn-1, pn, t)⟩, t)

Where t is the parametric distance, interp finds the point at the specified parametric distance between two points, and the angle brackets, ⟨⟩, specify a list of points. The file BezierCurve.java contains a class that represents a Bezier curve. It uses the class ArrayList.java to store all of the control points that define the curve. The deCasteljau method in the BezierCurve class should be completed so that it computes the point on the curve at the specified parametric distance. Be sure that your code verifies function parameters. Also be sure to test your code including special cases before submitting.

Submission: Submit your code as a zip file with your name as the zip file name on the course Inquire site.