Difference between revisions of "Rectangles"

From JSXGraph Wiki
Jump to navigationJump to search
 
(8 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
<jsxgraph width="300" height="300" box="box1">
 
<jsxgraph width="300" height="300" box="box1">
 +
(function() {
 
var b1 = JXG.JSXGraph.initBoard('box1', {boundingbox: [-5, 5, 5, -5], grid:true});
 
var b1 = JXG.JSXGraph.initBoard('box1', {boundingbox: [-5, 5, 5, -5], grid:true});
 
var p1 = b1.create('point', [-2,-2]),
 
var p1 = b1.create('point', [-2,-2]),
Line 9: Line 10:
 
p3.isDraggable = true;
 
p3.isDraggable = true;
 
p4.isDraggable = true;
 
p4.isDraggable = true;
 +
})();
 
</jsxgraph>
 
</jsxgraph>
  
  
 
<jsxgraph width="300" height="300" box="box2">
 
<jsxgraph width="300" height="300" box="box2">
var b2 = JXG.JSXGraph.initBoard('box2', {boundingbox: [-5, 5, 5, -5], axis:true, grid:true});
+
(function() {
 +
var b2 = JXG.JSXGraph.initBoard('box2', {boundingbox: [-5, 5, 5, -5], grid:true});
 
var p1 = b2.create('point', [-2,-2]),
 
var p1 = b2.create('point', [-2,-2]),
 
     p2 = b2.create('point', [3,3]),
 
     p2 = b2.create('point', [3,3]),
     pm = b2.create('midpoint', [p1, p2], {visible: true}),
+
     pm = b2.create('midpoint', [p1, p2], {visible: false}),
     circ = b2.create('circle', [pm, p1], {visible:true}),
+
     circ = b2.create('circle', [pm, p1], {visible: false}),
     p3 = b2.create('glider', [-2, 3, circ], {color:'blue'}),
+
     p3 = b2.create('glider', [-2, 3, circ], {color:'green'}),
     t = b2.create('transform', [180, function() {return pm.X();}, function() { return pm.Y();}], {type: 'rotate'}),
+
     t = b2.create('transform', [Math.PI, pm], {type: 'rotate'}),
 
     p4 = b2.create('point', [p3, t], {color:'blue'}),
 
     p4 = b2.create('point', [p3, t], {color:'blue'}),
     rect = b2.create('polygon',[p1,p3,p2,p4],{hasInnerPoints:true});
+
     rect = b2.create('polygon',[p1,p3,p2,p4],{hasInnerPoints:false});
 
+
})();
p3.isDraggable = true;
 
p4.isDraggable = true;
 
 
</jsxgraph>
 
</jsxgraph>
  

Latest revision as of 15:10, 14 October 2014