Even simpler function plotter

From JSXGraph Wiki
Revision as of 16:46, 22 March 2010 by A WASSERMANN (talk | contribs)

The underlying JavaScript code

var board = JXG.JSXGraph.initBoard('jxgbox', {boundingbox:[-5,8,8,-5], axis:true});

function plotter() {
  var t = board.algebra.geonext2JS(document.getElementById('input').value);
  var f = new Function('x','var y = '+t+'; return y;');
  board.create('functiongraph',[f]);
}
function clearAll(board) {
    JXG.JSXGraph.freeBoard(board);
    board = JXG.JSXGraph.initBoard('jxgbox', {boundingbox:[-5,8,8,-5], axis:true});
}