Secant and tangent: Difference between revisions
From JSXGraph Wiki
A WASSERMANN (talk | contribs) No edit summary |
A WASSERMANN (talk | contribs) No edit summary |
||
Line 16: | Line 16: | ||
p[2] = board.createElement('point', [2,0.5], {style:4}); | p[2] = board.createElement('point', [2,0.5], {style:4}); | ||
p[3] = board.createElement('point', [6,5], {style:4}); | p[3] = board.createElement('point', [6,5], {style:4}); | ||
var | var pol = board.lagrangePolynomial(p); | ||
graph = board.createElement('curve', ['x', pol, 'x', -10, 10], {curveType:'graph'}); | |||
graph = board.createElement('curve', ['x', | |||
q = board.createElement('glider', [4.5,0,graph], {style:6}); | q = board.createElement('glider', [4.5,0,graph], {style:6}); | ||
s = board.createElement('slider', [[0,-3],[4,-3],[0.001,1,1]],{name:' '}); | s = board.createElement('slider', [[0,-3],[4,-3],[0.001,1,1]],{name:' '}); | ||
q2 = board.createElement('point', [function(){ return q.X()+Math.max(s.X(),0.01);}, | q2 = board.createElement('point', [function(){ return q.X()+Math.max(s.X(),0.01);}, | ||
function(){ return | function(){ return pol(q.X()+Math.max(s.X(),0.01));}], {style:7}); | ||
e = board.createElement('point', [function(){ return q2.X()-q.X();}, | e = board.createElement('point', [function(){ return q2.X()-q.X();}, | ||
function(){ return (q2.Y()-q.Y())/(q2.X()-q.X());}], {style:7,name:'Sekantensteigung',trace:true}); | function(){ return (q2.Y()-q.Y())/(q2.X()-q.X());}], {style:7,name:'Sekantensteigung',trace:true}); |
Revision as of 19:12, 4 February 2009