Difference between revisions of "Euler line (dup)"

From JSXGraph Wiki
Jump to: navigation, search
(No difference)

Revision as of 08:36, 8 June 2011

The JavaScript code

brd = JXG.JSXGraph.initBoard('box', {boundingbox: [-2, 2, 2, -2], keepaspectratio:true});

brd.suspendUpdate();
A = brd.create('point',[1,0]);
B = brd.create('point',[-1,0]);
C = brd.create('point',[0.2,1.5]);
pol = brd.create('polygon',[A,B,C]);

pABC = brd.create('perpendicular',[pol.borders[0],C],{strokeWidth:1,dash:2});
pBCA = brd.create('perpendicular',[pol.borders[1],A],{strokeWidth:1,dash:2});
pCAB = brd.create('perpendicular',[pol.borders[2],B],{strokeWidth:1,strokeColor:'yellow',dash:2});
i1 = brd.create('intersection',[pABC,pCAB,0]);
pABC.setProperty({strokeColor:'#000000',dash:1,strokeWidth:1});
pBCA.setProperty({strokeColor:'#000000',dash:1,strokeWidth:1});
pCAB.setProperty({strokeColor:'#000000',dash:1,strokeWidth:1});

mAB = brd.create('midpoint',[A,B]);
mBC = brd.create('midpoint',[B,C]);
mCA = brd.create('midpoint',[C,A]);
ma = brd.create('segment',[mBC,A],{strokeWidth:1,strokeColor:'#333333',dash:2});
mb = brd.create('segment',[mCA,B],{strokeWidth:1,strokeColor:'#333333',dash:2});
mc = brd.create('segment',[mAB,C],{strokeWidth:1,strokeColor:'#333333',dash:2});
i2 = brd.create('intersection',[ma,mc,0]);

i3 = brd.create('circumcirclemidpoint',[A,B,C]);
c = brd.create('circumcircle',[A,B,C],{strokeColor:'#000000',dash:3,strokeWidth:1});

euler = brd.create('line',[i1,i3],{strokeWidth:2,strokeColor:'red'});
brd.unsuspendUpdate();