Multiple logarithmic spirals: Difference between revisions

From JSXGraph Wiki
No edit summary
No edit summary
 
(One intermediate revision by one other user not shown)
Line 4: Line 4:


<jsxgraph width="600" height="600" box="box1">
<jsxgraph width="600" height="600" box="box1">
  board = JXG.JSXGraph.initBoard('box1', {originX: 300, originY: 300, unitX: 25, unitY: 25});
  board = JXG.JSXGraph.initBoard('box1', {boundingbox: [-12, 12, 12, -12]});
  board.suspendUpdate();
  board.suspendUpdate();
  var a = board.createElement('slider', [[1,-1],[5,-1],[0,0.3,1]], {name:'a'});
  var a = board.create('slider', [[1,-1],[5,-1],[0,0.3,1]], {name:'a'});
  var b = board.createElement('slider', [[1,-2],[5,-2],[0,0.7,1]], {name:'b'});
  var b = board.create('slider', [[1,-2],[5,-2],[0,0.7,1]], {name:'b'});
  var tau = board.createElement('slider', [[-5,-3],[5,-3],[0,0,0.25]], {name:'&tau;'});
  var tau = board.create('slider', [[-5,-3],[5,-3],[0,0,0.5]], {name:'&tau;'});
  for (var i=0;i<8;i++) {
  for (var i=0;i<8;i++) {
   (function(x) { return board.createElement('curve', [function(phi){return a.Value()*Math.exp(b.Value()*(phi+Math.PI*x*0.25+tau.Value()*Math.PI)); }, [0, 0], -4*Math.PI, 8*Math.PI],
   (function(x) { return board.create('curve', [function(phi){return a.Value()*Math.exp(b.Value()*(phi+Math.PI*x*0.25+tau.Value()*Math.PI)); }, [0, 0], -4*Math.PI, 8*Math.PI],
             {curveType:'polar', strokewidth:1});         
             {curveType:'polar', strokewidth:1});         
   })(i);
   })(i);
Line 17: Line 17:
</jsxgraph>
</jsxgraph>


<source lang="xml">
<source lang="javascript">
  board = JXG.JSXGraph.initBoard('box1', {originX: 300, originY: 300, unitX: 25, unitY: 25});
  board = JXG.JSXGraph.initBoard('box1', {boundingbox: [-12, 12, 12, -12]});
  var a = board.createElement('slider', [[1,-1],[5,-1],[0,0.3,1]], {name:'a'});
  var a = board.create('slider', [[1,-1],[5,-1],[0,0.3,1]], {name:'a'});
  var b = board.createElement('slider', [[1,-2],[5,-2],[0,0.7,1]], {name:'b'});
  var b = board.create('slider', [[1,-2],[5,-2],[0,0.7,1]], {name:'b'});
  var tau = board.createElement('slider', [[-5,-3],[5,-3],[0,0,2]], {name:'&tau;'});
  var tau = board.create('slider', [[-5,-3],[5,-3],[0,0,2]], {name:'&tau;'});
  for (var i=0;i<8;i++) {
  for (var i=0;i<8;i++) {
   (function(x) { return board.createElement('curve', [function(phi){return a.Value()*Math.exp(b.Value()*(phi+Math.PI*x*0.25+tau.Value()*Math.PI)); }, [0, 0], -4*Math.PI, 8*Math.PI],
   (function(x) { return board.create('curve', [function(phi){return a.Value()*Math.exp(b.Value()*(phi+Math.PI*x*0.25+tau.Value()*Math.PI)); }, [0, 0], -4*Math.PI, 8*Math.PI],
             {curveType:'polar', strokewidth:1});         
             {curveType:'polar', strokewidth:1});         
   })(i);
   })(i);

Latest revision as of 09:49, 8 June 2011

Eight logarithmic spirals defined by

[math]\displaystyle{ r = ae^{b\theta + k\cdot\pi/4 + \tau}\,. }[/math]

 board = JXG.JSXGraph.initBoard('box1', {boundingbox: [-12, 12, 12, -12]});
 var a = board.create('slider', [[1,-1],[5,-1],[0,0.3,1]], {name:'a'});
 var b = board.create('slider', [[1,-2],[5,-2],[0,0.7,1]], {name:'b'});
 var tau = board.create('slider', [[-5,-3],[5,-3],[0,0,2]], {name:'&tau;'});
 for (var i=0;i<8;i++) {
   (function(x) { return board.create('curve', [function(phi){return a.Value()*Math.exp(b.Value()*(phi+Math.PI*x*0.25+tau.Value()*Math.PI)); }, [0, 0], -4*Math.PI, 8*Math.PI],
             {curveType:'polar', strokewidth:1});        
   })(i);
 }