Difference between revisions of "Parabola II"

From JSXGraph Wiki
Jump to navigationJump to search
Line 12: Line 12:
 
var par = board.create('parabola', [f, l]);
 
var par = board.create('parabola', [f, l]);
  
var P = board.create('glider', [-1, 2, par], {name: 'P'});  
+
var P = board.create('glider', [2, 2, par], {name: 'P'});  
 
var s1 = board.create('segment', [f,P]);
 
var s1 = board.create('segment', [f,P]);
//var s2 = board.create('segment', [f2,P]);
 
  
//var txt = board.create('text', [0.2, 4, () => "|Pf| + |Pf'| = " + P.Dist(f1).toFixed(2) + ' + ' +  P.Dist(f2).toFixed(2) + ' = ' + (P.Dist(f1) + P.Dist(f2)).toFixed(2)]);
+
var q = board.create('point', [()=>c.X(), ()=>P.Y()], {name:'q'});
 +
var s2 = board.create('segment', [q, P]);
 +
 
 +
var txt = board.create('text', [0.2, 4, () => "|Pf| + |Pq| = " + P.Dist(f).toFixed(2) + ' + ' +  P.Dist(q).toFixed(2) + ' = ' + (P.Dist(f) + P.Dist(q)).toFixed(2)]);
  
 
</jsxgraph>
 
</jsxgraph>

Revision as of 15:02, 28 June 2021

The underlying JavaScript code