Homework 3 (until 30.6. or 3 days before your exam)

Do not use the built-in functions for Bernstein basis or Bézier curves/surfaces.
You may use the built-in BSplineBasis[] function.

1. Consider the following control points:
{{0,-3},{1,-2},{(1/2),-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 the knot vector.
1.2 Use the knot insertion algorithm to add the knot (SuperStar[t])=3 to curve (Subscript[c, 1]). Plot the old curve, the new curve, and their control polygons all into one image.
1.3 Use the knot insertion algorithm to add the knots (Subscript[t, 1])=3, (Subscript[t, 2])=4, (Subscript[t, 3])=(9/2) to curve (Subscript[c, 1]). Plot the old curve, the new curve, and their control polygons all into one image.
1.4 Use the knot insertion algorithm to find the point (Subscript[c, 1])(5) on the curve (Subscript[c, 1]). Plot the curve (Subscript[c, 1]), the point (Subscript[c, 1])(5), and both the old control polygon and the control polygon used for finding (Subscript[c, 1])(5) into one image.

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)}.
2.1 Find the control points and weights to express (Subscript[c, 2]) as a rational Bézier curve. Plot the result (i.e. the curve and its control polygon).
2.2 Change the weights of (Subscript[c, 2]) so that its image doesn’t change and  (Subscript[c, 2])((π/4)) = {(3/(Sqrt[2])), (3/(Sqrt[2]))}. Plot the curve (Subscript[c, 2]) and the points (Subscript[c, 2])((π/4)), {(3/(Sqrt[2])), (3/(Sqrt[2]))} into one image to verify.
2.3 Use the rational DeCasteljau algorithm to compute (Subscript[c, 2])((π/4)).

3. Use a NURBS curve of degree 2 to inscribe a circle into a regular pentagon (i.e. find control points, weights, and a knot vector) without computing its radius. Plot the result.
Hint: All control points lie on the pentagon’s boundary.

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}}}.