Interpolation: Neville's algorithm

From JSXGraph Wiki
Revision as of 16:15, 29 July 2010 by A WASSERMANN (talk | contribs)

References

The underlying JavaScript code

<link rel="stylesheet" type="text/css" href="http://jsxgraph.uni-bayreuth.de/distrib/jsxgraph.css" />
<script type="text/javascript" src="http://jsxgraph.uni-bayreuth.de/distrib/jsxgraphcore.js"></script>
<div id="box" class="jxgbox" style="width:600px; height:400px;"></div>
    board = JXG.JSXGraph.initBoard('box', {axis:true, originX: 250, originY: 250, unitX: 50, unitY: 50});
    board.suspendUpdate();
    var p = [];
    p[0] = board.create('point', [-1,2], {style:6});
    p[1] = board.create('point', [3,-1], {style:6});
    p[2] = board.create('point', [2,1], {style:6});
    graph = board.create('curve', board.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],{style:6}));
      board.update();
    }