Difference between revisions of "Pappus's hexagon theorem"

From JSXGraph Wiki
Jump to navigationJump to search
 
(7 intermediate revisions by the same user not shown)
Line 12: Line 12:
  
 
var p1 = board.create('glider', [-1, -2, l1], {name:'p_1'});
 
var p1 = board.create('glider', [-1, -2, l1], {name:'p_1'});
var p2 = board.create('glider', [1, -2, l1], {name:'p_2'});
 
 
var p3 = board.create('glider', [3, -2, l1], {name:'p_3'});
 
var p3 = board.create('glider', [3, -2, l1], {name:'p_3'});
  
var p3s = board.create('glider', [-1, 1, l2], {name:"p_3'"});
+
var p3s = board.create('glider', [-1.5, 1, l2], {name:"p_3'"});
var p2s = board.create('glider', [0.5, 1, l2], {name:"p_2'"});
+
var p2s = board.create('glider', [0, 1, l2], {name:"p_2'"});
  
 
var s3 = board.create('segment', [p1, p3s], {color: 'black'});
 
var s3 = board.create('segment', [p1, p3s], {color: 'black'});
Line 22: Line 21:
  
 
var par1 = board.create('parallel', [s3, p3], {visible: false});
 
var par1 = board.create('parallel', [s3, p3], {visible: false});
var p1s = board.create('intersection', [par1, l2], {name:"p_1'"});
+
var p1s = board.create('intersection', [par1, l2], {name:"p_1'", color: 'black'});
//var s1 = board.create('segment', [p3, p1s], {color: 'black'});
+
var s1 = board.create('segment', [p3, p1s], {color: 'black'});
  
 +
var par2 = board.create('parallel', [s2, p1s], {visible: false});
 +
var p2 = board.create('intersection', [par2, l1], {name:"p_2", color: 'black'});
 +
var s4 = board.create('segment', [p2, p1s], {color: 'black'});
 +
 +
var s5 = board.create('segment', [p3, p2s], {color: 'red'});
 +
var s6 = board.create('segment', [p2, p3s], {color: 'red'});
 
</jsxgraph>
 
</jsxgraph>
 
  
 
=== The underlying JavaScript code ===
 
=== The underlying JavaScript code ===
  
 
<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 q = board.create('point', [-4, -2], {name:'q'});
 +
var q1 = board.create('point', [-1.5, -2], {name:'', color: 'blue'});
 +
var q2 = board.create('point', [-1.5, -1], {name:'', color: 'blue'});
 +
var l1 = board.create('line', [q, q1], {straightFirst: false});
 +
var l2 = board.create('line', [q, q2], {straightFirst: false});
 +
 +
var p1 = board.create('glider', [-1, -2, l1], {name:'p_1'});
 +
var p3 = board.create('glider', [3, -2, l1], {name:'p_3'});
 +
 +
var p3s = board.create('glider', [-1.5, 1, l2], {name:"p_3'"});
 +
var p2s = board.create('glider', [0, 1, l2], {name:"p_2'"});
 +
 +
var s3 = board.create('segment', [p1, p3s], {color: 'black'});
 +
var s2 = board.create('segment', [p1, p2s], {color: 'black'});
 +
 +
var par1 = board.create('parallel', [s3, p3], {visible: false});
 +
var p1s = board.create('intersection', [par1, l2], {name:"p_1'", color: 'black'});
 +
var s1 = board.create('segment', [p3, p1s], {color: 'black'});
 +
 +
var par2 = board.create('parallel', [s2, p1s], {visible: false});
 +
var p2 = board.create('intersection', [par2, l1], {name:"p_2", color: 'black'});
 +
var s4 = board.create('segment', [p2, p1s], {color: 'black'});
 +
 +
var s5 = board.create('segment', [p3, p2s], {color: 'red'});
 +
var s6 = board.create('segment', [p2, p3s], {color: 'red'});
 
</source>
 
</source>
  
 
[[Category:Examples]]
 
[[Category:Examples]]
 
[[Category:Geometry]]
 
[[Category:Geometry]]

Latest revision as of 20:58, 2 May 2021

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 q = board.create('point', [-4, -2], {name:'q'});
var q1 = board.create('point', [-1.5, -2], {name:'', color: 'blue'});
var q2 = board.create('point', [-1.5, -1], {name:'', color: 'blue'});
var l1 = board.create('line', [q, q1], {straightFirst: false});
var l2 = board.create('line', [q, q2], {straightFirst: false});

var p1 = board.create('glider', [-1, -2, l1], {name:'p_1'});
var p3 = board.create('glider', [3, -2, l1], {name:'p_3'});

var p3s = board.create('glider', [-1.5, 1, l2], {name:"p_3'"});
var p2s = board.create('glider', [0, 1, l2], {name:"p_2'"});

var s3 = board.create('segment', [p1, p3s], {color: 'black'});
var s2 = board.create('segment', [p1, p2s], {color: 'black'});

var par1 = board.create('parallel', [s3, p3], {visible: false});
var p1s = board.create('intersection', [par1, l2], {name:"p_1'", color: 'black'});
var s1 = board.create('segment', [p3, p1s], {color: 'black'});

var par2 = board.create('parallel', [s2, p1s], {visible: false});
var p2 = board.create('intersection', [par2, l1], {name:"p_2", color: 'black'});
var s4 = board.create('segment', [p2, p1s], {color: 'black'});

var s5 = board.create('segment', [p3, p2s], {color: 'red'});
var s6 = board.create('segment', [p2, p3s], {color: 'red'});