Newton's root finding method: Difference between revisions

From JSXGraph Wiki
No edit summary
No edit summary
Line 8: Line 8:
<td>
<td>
<form>
<form>
<input style="border:none; background-color:#efefef;padding:5px;margin-left:2px;" type="text" onchange="newGraph(this.value);" value="Math.sin(x)"  size="40"/>
<input style="border:none; background-color:#efefef;padding:5px;margin-left:2px;" type="text" onchange="newGraph(this.value);" value="x*x"  size="40"/>
</form>
</form>
</td>
</td>
Line 14: Line 14:
<script type="text/javascript">
<script type="text/javascript">
// Initial function term
// Initial function term
function term(x) { return Math.sin(x); }
function term(x) { return x*x; }
// Recursion depth
// Recursion depth
var steps = 11;
var steps = 11;
Line 40: Line 40:
}
}


board.addHook(xval);
//board.addHook(xval);


function newton(p, i) {
function newton(p, i) {

Revision as of 14:01, 3 February 2010

xo is the start value. Drag it.

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