You are on page 1of 1

Department of Mechanical Engineering

TME- 462 Computer Aided Design


Programming Lab 5
Instructor : Dr. Rakesh Saxena

Synthetic Curves
i) In the mathematical field of numerical analysis, Runge's phenomenon is a problem of oscillation at the
edges of an interval that occurs when using polynomial interpolation with polynomials of high degree over a set
of equispaced interpolation points. It was discovered by Carl David Tolmé Runge (1901) when exploring the
behavior of errors when using polynomial interpolation to approximate certain functions. The discovery was
important because it shows that going to higher degrees does not always improve accuracy. The phenomenon is
similar to the Gibbs phenomenon in Fourier series approximations. (Ref:
https://en.wikipedia.org/wiki/Runge%27s_phenomenon).

Now consider the Runge function f(x) = 1/(1+25x2). Plot this function in the range (-5,5). Fit a 10th degree
polynomial using 11 data points as x = -5:1:5. Label both the axes, give a suitable title to the figure, and
mention the actual function and the 10th degree interpolating curve on the plot. (HINT: use polyfit and polyval
command for interpolating function.)

ii) Draw two Bezier curves (bc1 and bc2). Data points for bc1 are: (1,0),(1,1),(2,1), and (2,0) and for bc2 are:
(3,0),(3,-1),(4,-1), and (4,0). Move some data points of bc2 to obtain (i) only c 0 and (ii) both c0 and c1 type of
continuities. Draw bc1 and bc2 for (i) and (ii). Also, mention the old and new locations of data points of bc2.

iii) Draw a Bezier curve using data points as: (2,0),(1,0),(1,1),(3,1),(3,0), and (2,0). Show the points u = 0.25,
0.5, and 0.75 using * symbol. Can you also show the coordinates of these three points on your plot? Also, show
the control points, label both the axes, and add a suitable title to your figure.

iv) Write a program to find the midpoint of a Hermite cubic spline with two points as (1,1) and (6,5) and the
corresponding tangent vectors as (0,4) and (4,0). Draw this spline and show the midpoint. Label both the axes,
and add a suitable title to your figure.

v) Draw a Bezier curve using the control points as: (1,3), (4,5), (5,7), and (8,4). Compute and show the points
at u = 0.4 and 0.6. Also, show the control points, label both the axes, and add a suitable title to your figure.

You might also like