Newton's root finding method: Difference between revisions

From JSXGraph Wiki
No edit summary
No edit summary
Line 15: Line 15:
<script type="text/javascript">
<script type="text/javascript">
// Initial function term
// Initial function term
var term;
var term = function(x) { return x*x; };
var graph;
// Recursion depth
      //function term(x) { return x*x; }
      // Recursion depth
var steps = 11;
var steps = 11;
// Start value
// Start value
Line 37: Line 35:
var x = board.create('glider',[s,0,ax], {name: 'x_{0}', strokeColor: 'magenta', fillColor: 'yellow'});
var x = board.create('glider',[s,0,ax], {name: 'x_{0}', strokeColor: 'magenta', fillColor: 'yellow'});


//function graph(x) { return term(x); }
var graph = function(x) { return term(x); };
newGraph(document.getElementById('graphterm').value);
newton(x,steps);
newton(x,steps);
function xval(board) {
function xval(board) {

Revision as of 14:08, 3 February 2010

xo is the start value. Drag it.

You may change the function term here:
f(x) =
;