Difference between revisions of "Centroid"

From JSXGraph Wiki
Jump to navigationJump to search
(Created page with "<html> <script type="text/javascript" src="/distrib/MathJax/MathJax.js"></script> </html> Centroid in affine space <jsxgraph width="500" height="500"> JXG.Options.label.au...")
 
Line 18: Line 18:
 
var l1 = board.create('arrow', [p1, p2], {withLabel: true, name:'\\(\\vec{v}\\)', label:{position: 'top', parse: false}, lastArrow: {type: 4, size: 8}});
 
var l1 = board.create('arrow', [p1, p2], {withLabel: true, name:'\\(\\vec{v}\\)', label:{position: 'top', parse: false}, lastArrow: {type: 4, size: 8}});
 
var l2 = board.create('arrow', [p1, p3], {withLabel: true, name:'\\(\\vec{w}\\)', label:{position: 'top', parse: false}, lastArrow: {type: 4, size: 8}});
 
var l2 = board.create('arrow', [p1, p3], {withLabel: true, name:'\\(\\vec{w}\\)', label:{position: 'top', parse: false}, lastArrow: {type: 4, size: 8}});
var l3 = board.create('arrow', [p3, p2], {});
+
var l3 = board.create('arrow', [p2, p3], {});
  
var m1 = board.create('midpoint', [p2, p3], {name:'\\(p_1\\)'});
+
var m1 = board.create('midpoint', [p2, p3], {name:'\\(m_1\\)'});
var m2 = board.create('midpoint', [p1, p3], {name:'\\(p_2\\)'});
+
var m2 = board.create('midpoint', [p1, p3], {name:'\\(m_2\\)'});
var m3 = board.create('midpoint', [p1, p2], {name:'\\(p_3\\)'});
+
var m3 = board.create('midpoint', [p1, p2], {name:'\\(m_3\\)'});
  
 
var s1 = board.create('segment', [p1, m1], {});
 
var s1 = board.create('segment', [p1, m1], {});

Revision as of 17:54, 12 April 2021

Centroid in affine space


The underlying JavaScript code

JXG.Options.label.autoPosition = true;
JXG.Options.text.useMathJax = true;
JXG.Options.text.fontSize = 20;

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

var p = board.create('point', [-3,-3], {name:'p'});
var q = board.create('point', [0, 2], {name:'q'});
var r = board.create('point', [3, -3], {name:'r'});

var pq = board.create('arrow', [p, q], {withLabel: true, name:'\\(\\vec{pq}\\)', label:{position: 'top', parse: false}, lastArrow: {type: 4, size: 8}});
var qr = board.create('arrow', [q, r], {withLabel: true, name:'\\(\\vec{qr}\\)', label:{position: 'top'}, lastArrow: {type: 4, size: 8}});
var pr = board.create('arrow', [p, r], {withLabel: true, name:'\\(\\vec{pr}\\)', label:{position: 'top'}, lastArrow: {type: 4, size: 8}});