Slider and function plot: Difference between revisions

From JSXGraph Wiki
No edit summary
No edit summary
 
Line 1: Line 1:
<jsxgraph width="600" height="600">
<jsxgraph width="600" height="600">
var brd = JXG.JSXGraph.initBoard('jxgbox', {boundingbox: [-10, 10, 10, -10], axis:true});       
(function(){
var a = brd.create('slider',[[2,-5],[7,-5],[-5,1,5]], {name:'a'});
var brd = JXG.JSXGraph.initBoard('jxgbox', {boundingbox: [-10, 10, 10, -10], axis:true}),
var b = brd.create('slider',[[2,-6],[7,-6],[-5,0,5]], {name:'b'});
    a = brd.create('slider',[[2,-5],[7,-5],[-5,1,5]], {name:'a'}),
var c = brd.create('slider',[[2,-7],[7,-7],[-5,0,5]], {name:'c'});
    b = brd.create('slider',[[2,-6],[7,-6],[-5,0,5]], {name:'b'}),
    c = brd.create('slider',[[2,-7],[7,-7],[-5,0,5]], {name:'c'}),


var f = brd.create('functiongraph',[function(x){
    f = brd.create('functiongraph',[function(x){
             return a.Value()*x*x + b.Value()*x + c.Value();
             return a.Value()*x*x + b.Value()*x + c.Value();
         }]);
         }]);
})();
</jsxgraph>


</jsxgraph>


===The code to produce this page===
<source lang="javascript">
var brd = JXG.JSXGraph.initBoard('jxgbox', {boundingbox: [-10, 10, 10, -10], axis:true}),
    a = brd.create('slider',[[2,-5],[7,-5],[-5,1,5]], {name:'a'}),
    b = brd.create('slider',[[2,-6],[7,-6],[-5,0,5]], {name:'b'}),
    c = brd.create('slider',[[2,-7],[7,-7],[-5,0,5]], {name:'c'}),
    f = brd.create('functiongraph',[function(x){
            return a.Value()*x*x + b.Value()*x + c.Value();
        }]);
</source>
[[Category:Examples]]
[[Category:Examples]]
[[Category:Calculus]]
[[Category:Calculus]]

Latest revision as of 09:20, 12 January 2015


The code to produce this page

var brd = JXG.JSXGraph.initBoard('jxgbox', {boundingbox: [-10, 10, 10, -10], axis:true}),
    a = brd.create('slider',[[2,-5],[7,-5],[-5,1,5]], {name:'a'}),
    b = brd.create('slider',[[2,-6],[7,-6],[-5,0,5]], {name:'b'}),
    c = brd.create('slider',[[2,-7],[7,-7],[-5,0,5]], {name:'c'}),

    f = brd.create('functiongraph',[function(x){
            return a.Value()*x*x + b.Value()*x + c.Value();
        }]);