Share JSXGraph: example "Curve interpolation: Neville's algorithm"

JSXGraph
Share JSXGraph: example "Curve interpolation: Neville's algorithm"
This website is a beta version. The official release will be in **2023**.

Curve interpolation: Neville's algorithm

<input type="button" value="Add point" onClick="addPoint()">
// Define the id of your board in BOARDID

const board = JXG.JSXGraph.initBoard(BOARDID, {axis:true, boundingbox: [-5, 5, 7, -3]});

// Create initial points
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});

// Create interpolation curve
var graph = board.create('curve', JXG.Math.Numerics.Neville(p), {strokeWidth:5, strokeOpacity:0.5});

// Add tangent
var g = board.create('glider', [graph], {color: 'blue'});
var t = board.create('tangent', [g], {dash:1, strokeColor:'green'});

// Add point at random position
var addPoint = function () {
    p.push(board.create('point', [(Math.random() - 0.5) * 10, (Math.random() - 0.5) * 3], {size:4}));
    board.update();
};