Homework 2 (until 1.5.2026)

1. Consider a Bézier curve (Subscript[c, 1]) given by the following control points:
{1, 6}, {-5, 3}, {-6, 0}, {-8, -5}, {-5, -7}, {1, -6}, {5, 3}, {8, -7}.
Do not use the built-in functions for Bézier curves or Bernstein basis!

1.1 Plot the curve (Subscript[c, 1]) with its control polygon.

1.2 Find the point (Subscript[c, 1])((14/17)) using the DeCasteljau algorithm. Plot the control polygons for each step of the algorithm into a single image along with the curve (Subscript[c, 1]).

1.3 Divide the curve (Subscript[c, 1]) into two Bézier curves of the same degree at point (Subscript[t, 0])=(1/3). Plot the two new curves and their control polygons into one image.

1.4 Apply the Degree elevation algorithm to the curve (Subscript[c, 1]). Plot both the new curve and (Subscript[c, 1]) with their control polygons into the same image.

2. Consider a parametric curve (Subscript[c, 2])={8sin(2t)(t^3)+1,5(((cos(4t+2)))^3)} for t ∈ [0, 1].
Do not use the built-in interpolation functions!

2.1 Sample 6 points on the curve (Subscript[c, 2]) and interpolate them by a polynomial curve of degree 5 using Lagrange interpolation. Plot the original curve, the sampled points, and the interpolation into one image.

2.2 Sample 20 points on the curve (Subscript[c, 2]) and approximate the curve by a polynomial curve of degree 5 using the least square method. Plot the original curve and its approximation into one image.
Feel free to use the built-in LeastSquares[] function.

2.3 Consider	a) k = 4,		b) k = 8,		c) k = 16,		d) k = 32,		e) k = 64.
Divide the curve (Subscript[c, 2]) into k parts. Reparametrize each part to the interval [0, 1] and interpolate the data at endpoints by cubic Hermite segments using the Ferguson polynomial basis. Plot the entire interpolation curve (Subscript[c, k]) consisting of the k Hermite segments into one image with the original curve. (Create a separate image for each k.)

2.4 Sample 640 points on the curve (Subscript[c, 2]). For each k = 4, 8, 16, 32, 64 sample 640 points on the curve (Subscript[c, k]) and use them to compute the Hausdorff error (distance) between interpolation (Subscript[c, k]) and the original curve (Subscript[c, 2]). Create a table presenting the Hausdorff error for each k.