Homework 3 (until 9.1.)

1. Consider the following control points:
{{0,-3},{1,-2},{0.5,-1},{-1,-1},{-6,1},{-3,4},{1,3}},
and the following knot vector:
{0,0,0,0,1,2,4,6,6,6,6}.
1.1 Plot the B-Spline curve (Subscript[c, 1]) defined by the control points and knot vector.
1.2 Write a function for the knot insertion algorithm. Use it to add knot (SuperStar[t])=3 to curve (Subscript[c, 1]).
1.3 Use the knot insertion algorithm to find the point (Subscript[c, 1])(5) on the curve (Subscript[c, 1]).

2. The curve (Subscript[c, 2]) is defined as a 1/6 of a circle, such that (Subscript[c, 2])(0) = {3,0}, (Subscript[c, 2])(1) = {(3/2), ((3(Sqrt[3]))/2)}, and  (Subscript[c, 2])((π/4)) = {(3/(Sqrt[2])), (3/(Sqrt[2]))}.
2.1 Find the control points and weights to express (Subscript[c, 2]) as a rational Bézier curve. Plot the result.
2.2 Use the rational DeCasteljau algorithm to compute (Subscript[c, 2])((π/4)).

3. Use a NURBS curve to inscribe a circle into a regular pentagon. (Find control points, weights and a knot vector.) Plot the result.

4. Plot a Bézier surface with the following control mesh:
{{{0,0,2},{3.1,0.5,3},{4.5,0,2}},{{-0.5,1.75,3},{1,2,-1},{5.2,2.25,3}},{{1,4.2,2},{2,3.8,4},{3,4,2}},{{-0.1,6.5,0},{3.2,6.2,2},{5.3,5.8,1}}}.

5. Write a function for the four-point subdivision scheme. Plot the first four iterations applied to the following polygon:
{{-2,-3},{-2,2},{0,1},{2,1},{1.5,-1}}