Grouping objects

From JSXGraph Wiki
Revision as of 14:34, 7 June 2011 by Michael (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

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);