Multiple logarithmic spirals: Difference between revisions
From JSXGraph Wiki
A WASSERMANN (talk | contribs) No edit summary |
A WASSERMANN (talk | contribs) No edit summary |
||
Line 1: | Line 1: | ||
Eight logarithmic spirals defined by | |||
:<math>r = ae^{b\theta + \pi/4*k + \tau}\,.</math> | |||
<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', {originX: 300, originY: 300, unitX: 25, unitY: 25}); | ||
var a = board.createElement('slider', [[1,-1],[5,-1],[0,0.3,1]], {name:'a'}); | var a = board.createElement('slider', [[1,-1],[5,-1],[0,0.3,1]], {name:'a'}); | ||
var b = board.createElement('slider', [[1,-2],[5,-2],[0,0. | var b = board.createElement('slider', [[1,-2],[5,-2],[0,0.7,1]], {name:'b'}); | ||
var tau = board.createElement('slider', [[1,-3],[5,-3],[0,0,2]], {name:'τ'}); | var tau = board.createElement('slider', [[1,-3],[5,-3],[0,0,2]], {name:'τ'}); | ||
for (var i=0;i<8;i++) { | for (var i=0;i<8;i++) { | ||
Line 11: | Line 15: | ||
</jsxgraph> | </jsxgraph> | ||
<source lang="xml"> | |||
board = JXG.JSXGraph.initBoard('box1', {originX: 300, originY: 300, unitX: 25, unitY: 25}); | |||
var a = board.createElement('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 tau = board.createElement('slider', [[1,-3],[5,-3],[0,0,2]], {name:'τ'}); | |||
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], | |||
{curveType:'polar', strokewidth:1}); | |||
})(i); | |||
} | |||
</source> | |||
[[Category:Examples]] | [[Category:Examples]] | ||
[[Category:Curves]] | [[Category:Curves]] |
Revision as of 17:55, 24 April 2009
Eight logarithmic spirals defined by
- [math]\displaystyle{ r = ae^{b\theta + \pi/4*k + \tau}\,. }[/math]
board = JXG.JSXGraph.initBoard('box1', {originX: 300, originY: 300, unitX: 25, unitY: 25});
var a = board.createElement('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 tau = board.createElement('slider', [[1,-3],[5,-3],[0,0,2]], {name:'τ'});
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],
{curveType:'polar', strokewidth:1});
})(i);
}