Time for action – interpolation
Open
ch5_Interpolation.html
using your HTML5 Internet browser.Select Linear interpolation if it is not already selected.
Move the start and end points using the slider provided.
Change the number of interpolation steps. What happens to the animation when you decrease the number of steps?
The code for the linear interpolation has been implemented in the
doLinearInterpolation
function.Now select Polynomial interpolation. In this example we have implemented Lagrange's interpolation method. You can see the source code in the
doLagrangeInterpolation
function.After selecting the polynomial interpolation, you will see that three new control points (flags) appear on screen. Using the sliders provided on the webpage, you can change the location of these control points. You can also change the number of interpolation steps.
You also may have noticed that whenever the ball approaches one of the flags (with the exception of the start and end points) the flag changes color...