Five Circle Theorem: Difference between revisions

From JSXGraph Wiki
No edit summary
No edit summary
Line 32: Line 32:


cc = brd.createElement('circumcircle',[j[0],j[2],j[3]],{strokeColor:'red'});
cc = brd.createElement('circumcircle',[j[0],j[2],j[3]],{strokeColor:'red'});
cc.setProperty({strokeColor:'red',strokeWidth:2});
cc[1].setProperty({strokeColor:'red',strokeWidth:2});


</jsxgraph>
</jsxgraph>
Line 52: Line 52:
p[4] = brd.createElement('point',[4,0],{name:''});
p[4] = brd.createElement('point',[4,0],{name:''});


l[0] = brd.createElement('segment',[p[0],p[1]],{});
for (k=0;k<5;k++) {
l[1] = brd.createElement('segment',[p[1],p[2]],{});
  l[k] = brd.createElement('segment',[p[k],p[(k+1)%5]],{});
l[2] = brd.createElement('segment',[p[2],p[3]],{});
}
l[3] = brd.createElement('segment',[p[3],p[4]],{});
l[4] = brd.createElement('segment',[p[4],p[0]],{});


i[0] = brd.createElement('point',[brd.intersection(l[0],l[2],0)],{name:''});
for (k=0;k<5;k++) {
i[1] = brd.createElement('point',[brd.intersection(l[1],l[3],0)],{name:''});
  i[k] = brd.createElement('point',[brd.intersection(l[k],l[(k+2)%5],0)],{name:''});
i[2] = brd.createElement('point',[brd.intersection(l[2],l[4],0)],{name:''});
}
i[3] = brd.createElement('point',[brd.intersection(l[3],l[0],0)],{name:''});
i[4] = brd.createElement('point',[brd.intersection(l[4],l[1],0)],{name:''});


c[0] = brd.createElement('circumcircle',[p[0],i[0],i[2]],{});
for (k=0;k<5;k++) {
c[1] = brd.createElement('circumcircle',[p[1],i[1],i[3]],{});
  c[k] = brd.createElement('circumcircle',[p[k],i[k],i[(k+2)%5]],{});
c[2] = brd.createElement('circumcircle',[p[2],i[2],i[4]],{});
c[3] = brd.createElement('circumcircle',[p[3],i[3],i[0]],{});
c[4] = brd.createElement('circumcircle',[p[4],i[4],i[1]],{});
for(k=0;k<5;k++) {
   c[k][1].setProperty({strokeColor:'gray',strokeWidth:1});
   c[k][1].setProperty({strokeColor:'gray',strokeWidth:1});
   c[k][0].setProperty({visible:false});
   c[k][0].setProperty({visible:false});
   l[k].setProperty({strokeColor:'gray',strokeWidth:1});
   l[k].setProperty({strokeColor:'gray',strokeWidth:1});
}
}
 
for (k=0;k<5;k++) {
j[0] = brd.createElement('point',[brd.intersection(c[0][1],c[2][1],0)],{style:4,name:''});
  j[k] = brd.createElement('point',[brd.intersection(c[k][1],c[(k+2)%5][1],0)],{style:4,name:''});
j[1] = brd.createElement('point',[brd.intersection(c[0][1],c[3][1],1)],{style:4,name:''});
}
j[2] = brd.createElement('point',[brd.intersection(c[3][1],c[1][1],1)],{style:4,name:''});
j[3] = brd.createElement('point',[brd.intersection(c[1][1],c[4][1],1)],{style:4,name:''});
j[4] = brd.createElement('point',[brd.intersection(c[4][1],c[2][1],1)],{style:4,name:''});


cc = brd.createElement('circumcircle',[j[0],j[2],j[3]],{strokeColor:'red'});
cc = brd.createElement('circumcircle',[j[0],j[2],j[3]],{strokeColor:'red'});

Revision as of 19:47, 16 September 2009

The underlying JavaScript code

var brd = JXG.JSXGraph.initBoard('jxgbox',{boundingbox:[-5,5,5,-5]});
var p = [];
var l = [];
var i = [];
var c = [];
var j = [];

p[0] = brd.createElement('point',[-2.5,-3],{name:''});
p[1] = brd.createElement('point',[-0,4],{name:''});
p[2] = brd.createElement('point',[2.5,-3],{name:''});
p[3] = brd.createElement('point',[-4,0],{name:''});
p[4] = brd.createElement('point',[4,0],{name:''});

for (k=0;k<5;k++) {
   l[k] = brd.createElement('segment',[p[k],p[(k+1)%5]],{});
}

for (k=0;k<5;k++) {
   i[k] = brd.createElement('point',[brd.intersection(l[k],l[(k+2)%5],0)],{name:''});
}

for (k=0;k<5;k++) {
   c[k] = brd.createElement('circumcircle',[p[k],i[k],i[(k+2)%5]],{});
   c[k][1].setProperty({strokeColor:'gray',strokeWidth:1});
   c[k][0].setProperty({visible:false});
   l[k].setProperty({strokeColor:'gray',strokeWidth:1});
}
for (k=0;k<5;k++) {
   j[k] = brd.createElement('point',[brd.intersection(c[k][1],c[(k+2)%5][1],0)],{style:4,name:''});
}

cc = brd.createElement('circumcircle',[j[0],j[2],j[3]],{strokeColor:'red'});
cc[1].setProperty({strokeColor:'red',strokeWidth:2});