Programming Assignment 1
Cubic Hermite Interpolation
|
General
This assignment implements piecewise cubic Hermite interpolation.
|
Your program should accomplish the following:
-
Allow the user to enter several data points which
will be displayed on the screen.
-
Generate a piecewise cubic Hermite interpolation
curve through these points, using non-uniform knot spacing.
-
Compute a default derivative at each data point.
Be sure to include comments in your code describing the method you use to
compute these default derivatives, and briefly outline your rationale.
-
Compute a default non-uniform knot spacing. As
above be sure to include comments and outline your rationale.
|
Code
-
You may program in any language, although Matlab
is recommended. If your program is in a language other than Matlab,
Mathematica, C/C++, or Java, I may ask you to demonstrate it.
-
Any package can be used for the viewing purpose.
You should not use build-in functions in Matlab, Mathematica, or other
packages for generating cubic Hermite interpolation.
-
Your code should be readable. The first part of
every function should contain a block of comments that give a detailed
description of the code's purpose, usage, and its input and output variables.
-
Your code should return warning and error
messages for invalid input data.
|
Input/Output
All values in the following descriptions are
floating point, unless preceded by int.
The input will consist of a file in the following
form:
int Number of Control Points
x0 y0
x1 y1
x2 y2
... ...
xn yn
|
What you should hand-in
Please hand in
|