Difference between revisions of "Power Series for sine"

From JSXGraph Wiki
Jump to navigationJump to search
Line 1: Line 1:
 
== Power Series for Sine ==
 
== Power Series for Sine ==
:<math>\sum_{k=0}^n (-1)^k\frac{1}{(2k+1)!}x^{2k+1}</math>
+
:<math>\sum_{k=0}^n a_k(x-x_0)^{k}</math>
  
 
<jsxgraph with="700" height="400">
 
<jsxgraph with="700" height="400">
Line 11: Line 11:
 
var s = brd.create('slider', [[0.75,-1.5],[5.75,-1.5],[0,0,10]], {name:'S',snapWidth:1});
 
var s = brd.create('slider', [[0.75,-1.5],[5.75,-1.5],[0,0,10]], {name:'S',snapWidth:1});
 
var x0 = brd.create('glider', [0,0,axx], {name:'x_0'});
 
var x0 = brd.create('glider', [0,0,axx], {name:'x_0'});
/*
 
 
brd.create('functiongraph', [
 
brd.create('functiongraph', [
 
function(t) {
 
function(t) {
var val = 0, i, sv = s.Value()+1;
+
var val = 0, i, sv = s.Value()+1, a;
 
for(i = 0; i < sv; i++) {
 
for(i = 0; i < sv; i++) {
  val = val + Math.pow(-1, i) * Math.pow(t, 2 * i + 1) / board1.factorial(2*i+1);
+
                  if (i%4==0) {
 +
                    a = Math.sin(x0.X());
 +
                  } else if (i%4==1) {
 +
                    a = Math.cos(x0.X());
 +
                  } else if (i%4==2) {
 +
                    a = -Math.sin(x0.X());
 +
                  } else if (i%4==3) {
 +
                    a = -Math.cos(x0.X());
 +
                  }
 +
            val = val + a*Math.pow(t-x0.X(), i) / brd.factorial(i);
 
}
 
}
 
return val;
 
return val;
 
},
 
},
 
-10, 10], {strokeColor: "#bb0000"});
 
-10, 10], {strokeColor: "#bb0000"});
*/
 
 
brd.unsuspendUpdate();
 
brd.unsuspendUpdate();
  
 
</jsxgraph>
 
</jsxgraph>

Revision as of 11:37, 28 May 2010

Power Series for Sine

[math]\sum_{k=0}^n a_k(x-x_0)^{k}[/math]