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

From JSXGraph Wiki

Jump to navigationJump to search(One intermediate revision by one other user not shown) | |||

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', | + | 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', | + | |

+ | 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'}); |

## Latest revision as of 22:39, 14 November 2020

### 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();
}
```