Difference between revisions of "Poincare disc model"

From JSXGraph Wiki
Jump to navigationJump to search
 
(34 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
<jsxgraph width="600" height="600">
 
<jsxgraph width="600" height="600">
 
var brd = JXG.JSXGraph.initBoard('jxgbox',{boundingbox:[-5,5,5,-5]});
 
var brd = JXG.JSXGraph.initBoard('jxgbox',{boundingbox:[-5,5,5,-5]});
var c = brd.create('circle',[[0,0],3],{strokeColor:'black'});
+
var c = brd.create('circle',[[0,0],3],{strokeColor:'black', fixed:true}); // outer circle
 +
 
 
var p = brd.create('point',[0,-4],{withLabel:false});
 
var p = brd.create('point',[0,-4],{withLabel:false});
var t = brd.create('polar', [c,p], {strokeColor:'gray', dash:2});  
+
var t = brd.create('polar', [c,p], {strokeColor:'gray', dash:2, visible:false});  
var s1 = brd.create('intersection', [c,t,0], {withLabel:false});  
+
var s1 = brd.create('intersection', [c,t,0], {withLabel:false, strokeColor:'green', fillColor:'green'});  
var s2 = brd.create('intersection', [c,t,1], {withLabel:false});  
+
var s2 = brd.create('intersection', [c,t,1], {withLabel:false, strokeColor:'green', fillColor:'green'});  
var arc = brd.create('arc',[p,s1,s2]);
+
var arc = brd.create('arc',[p,s1,s2],{name:'g', withLabel:true});
 +
 
 +
var pp = brd.create('point',[1,2],{withLabel:true,name:'P'});
 +
var t = brd.create('polar', [c,pp], {visible:false});
 +
var l = brd.create('line', [[0,0],pp], {visible:false});
 +
var A = brd.create('intersection', [l,t,0], {withLabel:true,visible:false});
 +
var M = brd.create('midpoint',[pp,A], {withLabel:true,visible:false});
 +
var perp = brd.create('perpendicular', [l,M], {name:'', withLabel:false, strokeColor:'gray', dash:1, straightFirst:true, straightLast:true, point: {visible:true}});
 +
 
 +
var x = brd.create('glider',[3, 3, perp], {name:'drag me'});
  
var pp = brd.create('point',[1,2],{withLabel:false});
+
var t2 = brd.create('polar', [c, x], {strokeColor:'gray', dash:2, visible:false});  
var t = brd.create('polar', [c,pp], {name:'polar', withLabel:true, strokeColor:'gray', dash:2});  
+
var ss1 = brd.create('intersection', [c,t2,0], {withLabel:false, strokeColor:'green', fillColor:'green'});  
var l = brd.create('line', [[0,0],pp], {name:'', withLabel:false, strokeColor:'gray', dash:2});  
+
var ss2 = brd.create('intersection', [c,t2,1], {withLabel:false, strokeColor:'green', fillColor:'green'});  
var A = brd.create('intersection', [l,t,0], {name:"A", withLabel:true, trace:true});
+
var arc = brd.create('circumcirclearc',[ss1,pp,ss2], {strokeWidth:1, trace:true, dash:3});
 +
</jsxgraph>
 +
===The JavaScript code===
 +
<source lang="javascript">
 +
var brd = JXG.JSXGraph.initBoard('jxgbox',{boundingbox:[-5,5,5,-5]});
 +
var c = brd.create('circle',[[0,0],3],{strokeColor:'black', fixed:true}); // outer circle
  
/*
+
var p = brd.create('point',[0,-4],{withLabel:false});
var l = brd.create('line',[[0,0],p],{dash:1});
+
var t = brd.create('polar', [c,p], {strokeColor:'gray', dash:2, visible:false});
 +
var s1 = brd.create('intersection', [c,t,0], {withLabel:false, strokeColor:'green', fillColor:'green'});
 +
var s2 = brd.create('intersection', [c,t,1], {withLabel:false, strokeColor:'green', fillColor:'green'});
 +
var arc = brd.create('arc',[p,s1,s2],{name:'g', withLabel:true});
  
var x = brd.create('glider',[3,3,l]);
+
var pp = brd.create('point',[1,2],{withLabel:true,name:'P'});
var l2 = brd.create('perpendicular',[l,x])[0];
+
var t = brd.create('polar', [c,pp], {visible:false});
 +
var l = brd.create('line', [[0,0],pp], {visible:false});  
 +
var A = brd.create('intersection', [l,t,0], {withLabel:true,visible:false});
 +
var M = brd.create('midpoint',[pp,A], {withLabel:true,visible:false});
 +
var perp = brd.create('perpendicular', [l,M], {name:'', withLabel:false, strokeColor:'gray', dash:1, straightFirst:true, straightLast:true, point: {visible:true}});
  
 +
var x = brd.create('glider',[3, 3, perp], {name:'drag me'});
  
var pp = brd.create('glider',[-4,4,l2],{name:'drag me',trace:true});
+
var t2 = brd.create('polar', [c, x], {strokeColor:'gray', dash:2, visible:false});
 +
var ss1 = brd.create('intersection', [c,t2,0], {withLabel:false, strokeColor:'green', fillColor:'green'});
 +
var ss2 = brd.create('intersection', [c,t2,1], {withLabel:false, strokeColor:'green', fillColor:'green'});
 +
var arc = brd.create('circumcirclearc',[ss1,pp,ss2], {strokeWidth:1, trace:true, dash:3});
 +
</source>
  
var t2 = brd.create('polar', [c,pp], {strokeColor:'gray', dash:2});
+
===References===
var s1 = brd.create('intersection', [c,t2,0], {withLabel:false});
+
* Chaim Goodman-Strauss, "Compass and Straightedge in the Poincare Disk", ''Am. Math. Monthly'' 108 (2001), 38-49.
var s2 = brd.create('intersection', [c,t2,1], {withLabel:false});
+
[[Category:Geometry]]
var arc = brd.create('circle',[pp,s1]);
+
[[Category:Examples]]
*/
 
</jsxgraph>
 

Latest revision as of 19:37, 17 January 2012

The JavaScript code

var brd = JXG.JSXGraph.initBoard('jxgbox',{boundingbox:[-5,5,5,-5]});
var c = brd.create('circle',[[0,0],3],{strokeColor:'black', fixed:true});  // outer circle

var p = brd.create('point',[0,-4],{withLabel:false});
var t = brd.create('polar', [c,p], {strokeColor:'gray', dash:2, visible:false}); 
var s1 = brd.create('intersection', [c,t,0], {withLabel:false, strokeColor:'green', fillColor:'green'}); 
var s2 = brd.create('intersection', [c,t,1], {withLabel:false, strokeColor:'green', fillColor:'green'}); 
var arc = brd.create('arc',[p,s1,s2],{name:'g', withLabel:true});

var pp = brd.create('point',[1,2],{withLabel:true,name:'P'});
var t = brd.create('polar', [c,pp], {visible:false}); 
var l = brd.create('line', [[0,0],pp], {visible:false}); 
var A = brd.create('intersection', [l,t,0], {withLabel:true,visible:false});
var M = brd.create('midpoint',[pp,A], {withLabel:true,visible:false});
var perp = brd.create('perpendicular', [l,M], {name:'', withLabel:false, strokeColor:'gray', dash:1, straightFirst:true, straightLast:true, point: {visible:true}});

var x = brd.create('glider',[3, 3, perp], {name:'drag me'});

var t2 = brd.create('polar', [c, x], {strokeColor:'gray', dash:2, visible:false}); 
var ss1 = brd.create('intersection', [c,t2,0], {withLabel:false, strokeColor:'green', fillColor:'green'}); 
var ss2 = brd.create('intersection', [c,t2,1], {withLabel:false, strokeColor:'green', fillColor:'green'}); 
var arc = brd.create('circumcirclearc',[ss1,pp,ss2], {strokeWidth:1, trace:true, dash:3});

References

  • Chaim Goodman-Strauss, "Compass and Straightedge in the Poincare Disk", Am. Math. Monthly 108 (2001), 38-49.