Difference between revisions of "Convergence of sequence"

From JSXGraph Wiki
Jump to navigationJump to search
Line 20: Line 20:
 
  var txt1 = board.create('text', [15, 1.6, function() { return 'n=' + (seq.dataX.length-1) + ': value = ' + seq.dataY[seq.dataY.length - 1]; }], {strokeColor: 'blue'});
 
  var txt1 = board.create('text', [15, 1.6, function() { return 'n=' + (seq.dataX.length-1) + ': value = ' + seq.dataY[seq.dataY.length - 1]; }], {strokeColor: 'blue'});
  
var approx = function() {
+
var TO;
 +
 
 +
var approx = function() {
 
     seq_add();
 
     seq_add();
 
     board.update();
 
     board.update();
 
     if (seq.dataX.length <= 50) {
 
     if (seq.dataX.length <= 50) {
         setTimeout(approx, 500);
+
         TO = setTimeout(approx, 500);
 
     }
 
     }
}
+
};
  
 
var a_n;
 
var a_n;
Line 36: Line 38:
  
 
var clear_all = function() {
 
var clear_all = function() {
 +
  clearTimeout(TO);
 
   seq.dataX = [0];
 
   seq.dataX = [0];
 
   seq.dataY = [1];
 
   seq.dataY = [1];
}
+
};
  
 
</jsxgraph>
 
</jsxgraph>

Revision as of 10:32, 7 January 2019

Compute values of

[math] (a_n)_{n\in{\mathbb N}}[/math].

nth-element of the sequence: