Difference between revisions of "The Multiplication Parabola"
From JSXGraph Wiki
Jump to navigationJump to searchA WASSERMANN (talk | contribs) |
|||
(3 intermediate revisions by one other user not shown) | |||
Line 1: | Line 1: | ||
<jsxgraph width="400" height="600" box="box"> | <jsxgraph width="400" height="600" box="box"> | ||
− | var brd = JXG.JSXGraph.initBoard('box', {axis:true, | + | var brd = JXG.JSXGraph.initBoard('box', {axis:true, boundingbox: [-4, 11, 4, -1]}); |
− | var f = brd. | + | var f = brd.create('functiongraph',[function(x){return x*x;}],{strokeColor:'black',highlightStrokeColor:'black'}); |
− | var a = brd. | + | var a = brd.create('glider',[-2,4,f]); |
− | var b = brd. | + | var b = brd.create('glider',[3,9,f]); |
− | var g = brd. | + | var g = brd.create('line',[a,b],{straightFirst:false,straightLast:false}); |
− | var p = brd. | + | var p = brd.create('point',[function(){return 0.0;},function(){return -a.X()*b.X();}],{fixed:true}); |
− | var t = brd. | + | var t = brd.create('text',[-1.5,9,function(){ return '-X(A)*X(B) = '+a.X().toFixed(2)+'*'+b.X().toFixed(2)+' = '+(-a.X()*b.X()).toFixed(2)+' = Y(C)';}]); |
</jsxgraph> | </jsxgraph> | ||
===The underlying JavaScript code=== | ===The underlying JavaScript code=== | ||
− | <source lang=" | + | <source lang="javascript"> |
− | + | var brd = JXG.JSXGraph.initBoard('box', {axis:true, boundingbox: [-4, 11, 4, -1]}); | |
+ | var f = brd.create('functiongraph',[function(x){return x*x;}],{strokeColor:'black',highlightStrokeColor:'black'}); | ||
+ | var a = brd.create('glider',[-2,4,f]); | ||
+ | var b = brd.create('glider',[3,9,f]); | ||
+ | var g = brd.create('line',[a,b],{straightFirst:false,straightLast:false}); | ||
+ | var p = brd.create('point',[function(){return 0.0;},function(){return -a.X()*b.X();}],{fixed:true}); | ||
+ | var t = brd.create('text',[-1.5,9,function(){ return '-X(A)*X(B) = '+a.X().toFixed(2)+'*'+b.X().toFixed(2)+' = '+(-a.X()*b.X()).toFixed(2)+' = Y(C)';}]); | ||
+ | </source> | ||
[[Category:Examples]] | [[Category:Examples]] |
Latest revision as of 09:30, 9 June 2011
The underlying JavaScript code
var brd = JXG.JSXGraph.initBoard('box', {axis:true, boundingbox: [-4, 11, 4, -1]});
var f = brd.create('functiongraph',[function(x){return x*x;}],{strokeColor:'black',highlightStrokeColor:'black'});
var a = brd.create('glider',[-2,4,f]);
var b = brd.create('glider',[3,9,f]);
var g = brd.create('line',[a,b],{straightFirst:false,straightLast:false});
var p = brd.create('point',[function(){return 0.0;},function(){return -a.X()*b.X();}],{fixed:true});
var t = brd.create('text',[-1.5,9,function(){ return '-X(A)*X(B) = '+a.X().toFixed(2)+'*'+b.X().toFixed(2)+' = '+(-a.X()*b.X()).toFixed(2)+' = Y(C)';}]);