Difference between revisions of "Ceva's theorem"

From JSXGraph Wiki
Jump to navigationJump to search
Line 1: Line 1:
TV(a,b,c) is the affine ratio |ac| / |ab|.
+
TV(a,b,c) is the affine ratio, i.e the signed value of |ac| / |ab|.
  
 
<jsxgraph width="500" height="500">
 
<jsxgraph width="500" height="500">
Line 5: Line 5:
 
JXG.Options.text.fontSize = 24;
 
JXG.Options.text.fontSize = 24;
  
var board = JXG.JSXGraph.initBoard("jxgbox", {boundingbox: [-5,5,5,-5], axis:true, showCopyright:false, showNavigation:false});
+
var board = JXG.JSXGraph.initBoard("jxgbox", {boundingbox: [-5,5,5,-5], axis:false, showCopyright:false, showNavigation:false});
  
 
var a = board.create('point', [-4, 0], {name:'a'});
 
var a = board.create('point', [-4, 0], {name:'a'});
Line 15: Line 15:
 
var s3 = board.create('segment', [c, b], {color: 'black'});
 
var s3 = board.create('segment', [c, b], {color: 'black'});
  
var as = board.create('glider', [-4, 0, s3], {name:"a'"});
+
var as = board.create('glider', [3, 0, s3], {name:"a'"});
 
var bs = board.create('glider', [4, -3, s2], {name:"b'"});
 
var bs = board.create('glider', [4, -3, s2], {name:"b'"});
 
var cs = board.create('glider', [1, 4, s1], {name:"c'"});
 
var cs = board.create('glider', [1, 4, s1], {name:"c'"});
Line 36: Line 36:
  
 
<source lang="javascript">
 
<source lang="javascript">
 +
JXG.Options.label.autoPosition = true;
 +
JXG.Options.text.fontSize = 24;
 +
 +
var board = JXG.JSXGraph.initBoard("jxgbox", {boundingbox: [-5,5,5,-5], axis:false, showCopyright:false, showNavigation:false});
 +
 +
var a = board.create('point', [-4, 0], {name:'a'});
 +
var b = board.create('point', [4, -3], {name:'b'});
 +
var c = board.create('point', [1, 4], {name:'c'});
 +
 +
var s1 = board.create('segment', [a, b], {color: 'black'});
 +
var s2 = board.create('segment', [a, c], {color: 'black'});
 +
var s3 = board.create('segment', [c, b], {color: 'black'});
 +
 +
var as = board.create('glider', [3, 0, s3], {name:"a'"});
 +
var bs = board.create('glider', [4, -3, s2], {name:"b'"});
 +
var cs = board.create('glider', [1, 4, s1], {name:"c'"});
 +
 +
var s4 = board.create('segment', [a, as], {color: 'black'});
 +
var s5 = board.create('segment', [b, bs], {color: 'black'});
 +
var s6 = board.create('segment', [c, cs], {color: 'black'});
 +
 +
 +
var TV = function(p,q,t) {
 +
        return p.Dist(t) / p.Dist(q);
 +
    };
 +
 +
var txt = board.create('text', [-4.5, -4, function() {
 +
        return "TV(a',c,b) * TV(b',a,c) * TV(c',b,a) = " + (TV(as,c,b)*TV(bs,a,c)*TV(cs,b,a)).toFixed(2); }]);
 
</source>
 
</source>
  
 
[[Category:Examples]]
 
[[Category:Examples]]
 
[[Category:Geometry]]
 
[[Category:Geometry]]

Revision as of 22:52, 2 May 2021

TV(a,b,c) is the affine ratio, i.e the signed value of |ac| / |ab|.

The underlying JavaScript code

JXG.Options.label.autoPosition = true;
JXG.Options.text.fontSize = 24;

var board = JXG.JSXGraph.initBoard("jxgbox", {boundingbox: [-5,5,5,-5], axis:false, showCopyright:false, showNavigation:false});

var a = board.create('point', [-4, 0], {name:'a'});
var b = board.create('point', [4, -3], {name:'b'});
var c = board.create('point', [1, 4], {name:'c'});

var s1 = board.create('segment', [a, b], {color: 'black'});
var s2 = board.create('segment', [a, c], {color: 'black'});
var s3 = board.create('segment', [c, b], {color: 'black'});

var as = board.create('glider', [3, 0, s3], {name:"a'"});
var bs = board.create('glider', [4, -3, s2], {name:"b'"});
var cs = board.create('glider', [1, 4, s1], {name:"c'"});

var s4 = board.create('segment', [a, as], {color: 'black'});
var s5 = board.create('segment', [b, bs], {color: 'black'});
var s6 = board.create('segment', [c, cs], {color: 'black'});


var TV = function(p,q,t) {
        return p.Dist(t) / p.Dist(q);
    };

var txt = board.create('text', [-4.5, -4, function() {
        return "TV(a',c,b) * TV(b',a,c) * TV(c',b,a) = " + (TV(as,c,b)*TV(bs,a,c)*TV(cs,b,a)).toFixed(2); }]);