Files to download todayHere are some files to download (and extract to the /src folder of your Eclipse project):
Java documentation
Here is the javaDoc
concerning the packages and classes used today: |
Example of execution of class Draw: you should obtain a frame to display points and segments. Click with left button to add a new point, Click with right button, to delete a point, Press 'd' to remove the last point. Press 's' to change the interpolation method (by default, at the beginning there is no interpolation) Additional features (you have to implement them) Press 't' to perform a translation. Press 'i' or 'o' to perform a scaling (zoom in/out). Press 'r' to perform a rotation. |
Implementing linear interpolation
|
Example: linear interpolation of 6 points: (x0, y0) ... (x5, y5). |
Given a set of n
points to interpolate, you have to solve a system of n
equations (with n variables), represented in
matrix form (as illustrated during the Lecture), as
follows:
|
Example: Lagrange interpolation of 6 points: (x0, y0) ... (x5, y5). The goal is to compute the coefficients of the polynomial expression for f(x), by solving a linear system of equations. |
Interpolating 10 points |
Addition of a point (the rightmost one) |
After adding a further point |
Given a set of n
points to interpolate, you have to solve a system of 4(n-1)
equations (with 4(n-1) variables), represented
in matrix form as below.
|
Example: cubic spline interpolation of 4 points: (x0, y0), (x1, y1), (x2, y2), (x3, y3). The goal is to compute cubic polynomial expressions for f0, f1, f2 |
Now, let us suppose we are
given:
Remark: for the sake of
simplicity, the slopes (the n vectors {ti})
are provided as predefined parameters in the code (their
are constant). -) f interpolates points pi=(xi, yi), -) f respects C1 constraints (given by tangents)
|
Example: Hermite cubic spline interpolation of 3 points: (x0, y0), (x1, y1), (x2, y2). The goal is to compute parametric expressions for f0, f1. |