Difference between revisions of "Euler line (dup)"

From JSXGraph Wiki
Jump to navigationJump to search
m (lines with straight*=false changed to segments)
Line 19: Line 19:
 
mBC = brd.createElement('midpoint',[B,C]);
 
mBC = brd.createElement('midpoint',[B,C]);
 
mCA = brd.createElement('midpoint',[C,A]);
 
mCA = brd.createElement('midpoint',[C,A]);
ma = brd.createElement('line',[mBC,A],{straightFirst:false,straightLast:false,strokeWidth:1,strokeColor:'#333333',dash:2});
+
ma = brd.createElement('segment',[mBC,A],{strokeWidth:1,strokeColor:'#333333',dash:2});
mb = brd.createElement('line',[mCA,B],{straightFirst:false,straightLast:false,strokeWidth:1,strokeColor:'#333333',dash:2});
+
mb = brd.createElement('segment',[mCA,B],{strokeWidth:1,strokeColor:'#333333',dash:2});
mc = brd.createElement('line',[mAB,C],{straightFirst:false,straightLast:false,strokeWidth:1,strokeColor:'#333333',dash:2});
+
mc = brd.createElement('segment',[mAB,C],{strokeWidth:1,strokeColor:'#333333',dash:2});
 
i2 = brd.createElement('intersection',[ma,mc,0]);
 
i2 = brd.createElement('intersection',[ma,mc,0]);
  
Line 56: Line 56:
 
mBC = brd.createElement('midpoint',[B,C]);
 
mBC = brd.createElement('midpoint',[B,C]);
 
mCA = brd.createElement('midpoint',[C,A]);
 
mCA = brd.createElement('midpoint',[C,A]);
ma = brd.createElement('line',[mBC,A],{straightFirst:false,straightLast:false,strokeWidth:1,strokeColor:'#333333',dash:2});
+
ma = brd.createElement('segment',[mBC,A],{strokeWidth:1,strokeColor:'#333333',dash:2});
mb = brd.createElement('line',[mCA,B],{straightFirst:false,straightLast:false,strokeWidth:1,strokeColor:'#333333',dash:2});
+
mb = brd.createElement('segment',[mCA,B],{strokeWidth:1,strokeColor:'#333333',dash:2});
mc = brd.createElement('line',[mAB,C],{straightFirst:false,straightLast:false,strokeWidth:1,strokeColor:'#333333',dash:2});
+
mc = brd.createElement('segment',[mAB,C],{strokeWidth:1,strokeColor:'#333333',dash:2});
 
i2 = brd.createElement('intersection',[ma,mc,0]);
 
i2 = brd.createElement('intersection',[ma,mc,0]);
  

Revision as of 10:51, 27 August 2009

The JavaScript code

<jsxgraph width="500" height="500" box="box">
brd = JXG.JSXGraph.initBoard('box', {boundingbox: [-2, 2, 2, -2], keepaspectratio:true});

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

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

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

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

euler = brd.createElement('line',[i1,i3],{strokeWidth:2,strokeColor:'red'});
brd.unsuspendUpdate();
</jsxgraph>