Secant and tangent: Difference between revisions

From JSXGraph Wiki
No edit summary
No edit summary
Line 66: Line 66:
                       function(){ return (qf2.Y()-qf.Y())/(qf2.X()-qf.X());}], {style:7,name:'Sekantensteigung',trace:true});
                       function(){ return (qf2.Y()-qf.Y())/(qf2.X()-qf.X());}], {style:7,name:'Sekantensteigung',trace:true});
         line = board.createElement('line',[qf,qf2],{strokeColor:'#ff0000'});
         line = board.createElement('line',[qf,qf2],{strokeColor:'#ff0000'});
board.unsuspendUpdate();
</script>
</html>
<html>
<div id="box3" class="jxgbox" style="width:600px; height:400px;"></div>
<script language="JavaScript">
        board = JXG.JSXGraph.initBoard('box3', {originX: 250, originY: 250, unitX: 50, unitY: 25});
board.suspendUpdate();
        // Axes
        b1axisx = board.createElement('axis', [[0,0], [1,0]], {});
        b1axisy = board.createElement('axis', [[0,0], [0,1]], {});
        var g = function(x) { return (x<=0)?0:1; };
        graph = board.createElement('curve', ['x', f, 'x', -10, 10], {curveType:'graph'});
        qg = board.createElement('glider', [0,0,graph], {style:6});
        sg = board.createElement('slider', [0,-3,4,0,1,1],{name:' '});
        qg2 = board.createElement('point', [function(){ return qg.X()+sg.X();},
                            function(){ return f(qg.X()+sg.X());}], {style:7});
        eg = board.createElement('point', [function(){ return qg2.X()-qg.X();},
                      function(){ return (qg2.Y()-qg.Y())/(qg2.X()-qg.X());}], {style:7,name:'Sekantensteigung',trace:true});
        line = board.createElement('line',[qg,qg2],{strokeColor:'#ff0000'});
board.unsuspendUpdate();
board.unsuspendUpdate();
</script>
</script>

Revision as of 13:44, 16 January 2009