Colorful circles: Difference between revisions

From JSXGraph Wiki
No edit summary
No edit summary
Line 1: Line 1:
<jsxgraph width="600" height="600">
<jsxgraph width="600" height="600">
JXG.Options.point.zoom = true;
JXG.Options.point.zoom = true;
var brd = JXG.JSXGraph.initBoard('jxgbox', {boundingbox:[-0.1,1.1,1.1,-0.1], takeFirst: true});
var brd = JXG.JSXGraph.initBoard('jxgbox', {boundingbox:[-0.1,1.1,1.1,-0.1], takeFirst: false});
var i, h, s, v;
var i, h, s, v;



Revision as of 12:40, 3 February 2015

The underlying JavaScript code

JXG.Options.point.zoom = true;
var brd = JXG.JSXGraph.initBoard('jxgbox', {boundingbox:[-0.1,1.1,1.1,-0.1]});
var i, h, s, v;

for (i=0;i<30;i++) {
  h = Math.random()*360;
  s = Math.random();
  v = 1.0;
  brd.createElement('point',[Math.random(),Math.random()],
     {
       withLabel:false, 
       face:'circle', 
       size:Math.random()*65,
       strokeColor:JXG.hsv2rgb(h,s,v),
       fillColor:JXG.hsv2rgb((h+180)%360,s,v),
       highlightFillColor:JXG.hsv2rgb(h,s,v),
       fillOpacity:0.7,
       highlightFillOpacity:0.4
      });
}