Difference between revisions of "Cubic spline interpolation"

From JSXGraph Wiki
Jump to navigationJump to search
 
Line 16: Line 16:
 
         p[0] = board.createElement('point', [-1,2], {style:6});
 
         p[0] = board.createElement('point', [-1,2], {style:6});
 
         p[1] = board.createElement('point', [3,-1], {style:6});
 
         p[1] = board.createElement('point', [3,-1], {style:6});
 +
        p[2] = board.createElement('point', [5,0], {style:6});
  
 
         function computeSpline() {
 
         function computeSpline() {

Revision as of 19:48, 3 December 2008

Constructs a cubic spline through given points. Points can be added by clicking on "Add point".

        function addPoint() {
          p.push(board.createElement('point',[(Math.random()-0.5)*10,(Math.random()-0.5)*3],{style:6}));
          board.update();
        }