Grouping objects: Difference between revisions

From JSXGraph Wiki
No edit summary
No edit summary
Line 6: Line 6:
<script type="text/javascript">
<script type="text/javascript">
var b1 = JXG.JSXGraph.initBoard('jxgbox', {originX: 200, originY: 150, unitX: 50, unitY: 50});
var b1 = JXG.JSXGraph.initBoard('jxgbox', {originX: 200, originY: 150, unitX: 50, unitY: 50});
var p = [];
var pArr = [];
p[0] = b1.createElement('point',[0,0], {name:'A',style:6});
pArr[0] = b1.createElement('point',[0,0], {name:'A',style:6});
p[1] = b1.createElement('point',[2,1], {name:'B',style:6});
pArr[1] = b1.createElement('point',[2,1], {name:'B',style:6});
p[2] = b1.createElement('point',[2,2], {name:'C',style:6});
pArr[2] = b1.createElement('point',[2,2], {name:'C',style:6});
p[3] = b1.createElement('point',[0,1], {name:'D',style:6});
pArr[3] = b1.createElement('point',[0,1], {name:'D',style:6});
 
var poly = b1.createElement('polygon',pArr);
var gr = new JXG.Group(b1,'','',pArr);
 
 
var qArr = [];
qArr[0] = b1.createElement('point',[-1,0], {name:'a',style:6});
qArr[1] = b1.createElement('point',[-2,-1], {name:'b',style:6});
qArr[2] = b1.createElement('point',[-2,-2], {name:'c',style:6});
qArr[3] = b1.createElement('point',[0,-1], {name:'d',style:6});


var poly = b1.createElement('polygon',p);
var g = new JXG.Group(b1,'','',p);
</script>
</script>
</html>
</html>

Revision as of 13:18, 16 December 2008