Grouping objects: Difference between revisions
From JSXGraph Wiki
A WASSERMANN (talk | contribs) (New page: <html> <link rel="stylesheet" type="text/css" href="http://jsxgraph.uni-bayreuth.de/distrib/jsxgraph.css" /> <script type="text/javascript" src="http://jsxgraph.uni-bayreuth.de/distrib/pro...) |
No edit summary |
||
(12 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
< | <jsxgraph width="500" height="300" box="jxgbox"> | ||
var b1 = JXG.JSXGraph.initBoard('jxgbox', {boundingbox: [-4, 3, 6, -3]}); | |||
var pArr = []; | |||
pArr[0] = b1.create('point',[0,0], {size:4}); | |||
pArr[1] = b1.create('point',[2,1], {size:4}); | |||
pArr[2] = b1.create('point',[2,2], {size:4}); | |||
var b1 = JXG.JSXGraph.initBoard('jxgbox', { | pArr[3] = b1.create('point',[0,1], {size:4}); | ||
var | |||
var poly = b1. | var poly = b1.create('polygon',pArr); | ||
var gr = b1.create('group',pArr); | |||
</ | </jsxgraph> | ||
==The underlying JavaScript code== | |||
<source lang="javascript"> | |||
var b1 = JXG.JSXGraph.initBoard('jxgbox', {boundingbox: [-4, 3, 6, -3]}); | |||
var pArr = []; | |||
pArr[0] = b1.create('point',[0,0], {size:4}); | |||
pArr[1] = b1.create('point',[2,1], {size:4}); | |||
pArr[2] = b1.create('point',[2,2], {size:4}); | |||
pArr[3] = b1.create('point',[0,1], {size:4}); | |||
var poly = b1.create('polygon',pArr); | |||
</source> | |||
The points are grouped together with the following command: | |||
<source lang="javascript"> | |||
var gr = b1.create('group',pArr); | |||
</source> | |||
[[Category:Examples]] | [[Category:Examples]] |
Latest revision as of 14:34, 7 June 2011
The underlying JavaScript code
var b1 = JXG.JSXGraph.initBoard('jxgbox', {boundingbox: [-4, 3, 6, -3]});
var pArr = [];
pArr[0] = b1.create('point',[0,0], {size:4});
pArr[1] = b1.create('point',[2,1], {size:4});
pArr[2] = b1.create('point',[2,2], {size:4});
pArr[3] = b1.create('point',[0,1], {size:4});
var poly = b1.create('polygon',pArr);
The points are grouped together with the following command:
var gr = b1.create('group',pArr);