Thales theorem: Difference between revisions

From JSXGraph Wiki
No edit summary
No edit summary
 
(6 intermediate revisions by the same user not shown)
Line 1: Line 1:
<math>TV(p,q,t)</math> is the affine / simple ratio of the collinear points ''p'', ''q'' and ''t''.
<jsxgraph width="500" height="500">
<jsxgraph width="500" height="500">
JXG.Options.label.autoPosition = true;
JXG.Options.label.autoPosition = true;
Line 17: Line 19:
var t2 = board.create('intersection', [l4, l2], {name: 't_2'});
var t2 = board.create('intersection', [l4, l2], {name: 't_2'});


var txt1 = board.create('text', [-2, -2, function() { return 'TV(p,q_1,t_1) = ' + (t1.dist(p) / q1.dist(p)).toFixed(2)]);
var txt1 = board.create('text', [-3, -3, function() { return 'TV(p,q_1,t_1) = ' + (t1.Dist(p) / q1.Dist(p)).toFixed(2); }]);
var txt2 = board.create('text', [-3, -4, function() { return 'TV(p,q_2,t_2) = ' + (t2.Dist(p) / q2.Dist(p)).toFixed(2); }]);
</jsxgraph>
</jsxgraph>


Line 24: Line 27:


<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], showCopyright:false, showNavigation:false});
var p = board.create('point', [-3, -2], {name:'p'});
var q1 = board.create('point', [0, -2], {name:'q_1'});
var q2 = board.create('point', [-1, 0.5], {name:'q_2'});
var l1 = board.create('line', [p, q1], {straightFirst: false});
var l2 = board.create('line', [p, q2], {straightFirst: false});
var l3 = board.create('line', [q1, q2], {color: 'black'});
var q3 = board.create('point', [2.5, 2], {visible: false});
var l4 = board.create('parallel', [l3, q3], {color: 'black'});
var t1 = board.create('intersection', [l4, l1], {name: 't_1'});
var t2 = board.create('intersection', [l4, l2], {name: 't_2'});
var txt1 = board.create('text', [-3, -3, function() { return 'TV(p,q_1,t_1) = ' + (t1.Dist(p) / q1.Dist(p)).toFixed(2); }]);
var txt2 = board.create('text', [-3, -4, function() { return 'TV(p,q_2,t_2) = ' + (t2.Dist(p) / q2.Dist(p)).toFixed(2); }]);
</source>
</source>
[[Category:Examples]]
[[Category:Examples]]
[[Category:Geometry]]
[[Category:Geometry]]

Latest revision as of 07:05, 3 May 2021

[math]\displaystyle{ TV(p,q,t) }[/math] is the affine / simple ratio of the collinear points p, q and t.


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], showCopyright:false, showNavigation:false});

var p = board.create('point', [-3, -2], {name:'p'});
var q1 = board.create('point', [0, -2], {name:'q_1'});
var q2 = board.create('point', [-1, 0.5], {name:'q_2'});
var l1 = board.create('line', [p, q1], {straightFirst: false});
var l2 = board.create('line', [p, q2], {straightFirst: false});
var l3 = board.create('line', [q1, q2], {color: 'black'});

var q3 = board.create('point', [2.5, 2], {visible: false});
var l4 = board.create('parallel', [l3, q3], {color: 'black'});
var t1 = board.create('intersection', [l4, l1], {name: 't_1'});
var t2 = board.create('intersection', [l4, l2], {name: 't_2'});

var txt1 = board.create('text', [-3, -3, function() { return 'TV(p,q_1,t_1) = ' + (t1.Dist(p) / q1.Dist(p)).toFixed(2); }]);
var txt2 = board.create('text', [-3, -4, function() { return 'TV(p,q_2,t_2) = ' + (t2.Dist(p) / q2.Dist(p)).toFixed(2); }]);