Difference between revisions of "Interpolation: Neville's algorithm"

From JSXGraph Wiki
Jump to navigationJump to search
Line 9: Line 9:
 
     p[1] = board.create('point', [3,-1], {size:4});
 
     p[1] = board.create('point', [3,-1], {size:4});
 
     p[2] = board.create('point', [2,1], {size:4});
 
     p[2] = board.create('point', [2,1], {size:4});
     graph = board.create('curve', board.neville(p),{strokeWidth:5,strokeOpacity:0.5});
+
     graph = board.create('curve', JXG.Math.Numerics.Neville(p),{strokeWidth:5,strokeOpacity:0.5});
 
     g = board.create('glider', [graph], {name:'Glider'});
 
     g = board.create('glider', [graph], {name:'Glider'});
 
     t = board.create('tangent', [g],{dash:1,strokeColor:'green'});
 
     t = board.create('tangent', [g],{dash:1,strokeColor:'green'});
Line 33: Line 33:
 
p[1] = board.create('point', [3,-1], {size:4});
 
p[1] = board.create('point', [3,-1], {size:4});
 
p[2] = board.create('point', [2,1], {size:4});
 
p[2] = board.create('point', [2,1], {size:4});
var graph = board.create('curve', board.neville(p),{strokeWidth:5,strokeOpacity:0.5});
+
var graph = board.create('curve', JXG.Math.Numerics.Neville(p),{strokeWidth:5,strokeOpacity:0.5});
 
g = board.create('glider', [graph]);
 
g = board.create('glider', [graph]);
 
t = board.create('tangent', [g],{dash:1,strokeColor:'green'});
 
t = board.create('tangent', [g],{dash:1,strokeColor:'green'});

Revision as of 21:10, 18 January 2013

References

The underlying JavaScript code

board = JXG.JSXGraph.initBoard('box', {axis:true, boundingbox: [-5, 5, 7, -3]});
board.suspendUpdate();
var p = [];
p[0] = board.create('point', [-1,2], {size:4});
p[1] = board.create('point', [3,-1], {size:4});
p[2] = board.create('point', [2,1], {size:4});
var graph = board.create('curve', JXG.Math.Numerics.Neville(p),{strokeWidth:5,strokeOpacity:0.5});
g = board.create('glider', [graph]);
t = board.create('tangent', [g],{dash:1,strokeColor:'green'});
board.unsuspendUpdate();
      
function addPoint() {
    p.push(board.create('point',[(Math.random()-0.5)*10,(Math.random()-0.5)*3],{size:4}));
    board.update();
}