Lissajous curves: Difference between revisions
From JSXGraph Wiki
A WASSERMANN (talk | contribs) No edit summary |
A WASSERMANN (talk | contribs) No edit summary |
||
Line 6: | Line 6: | ||
var brd = JXG.JSXGraph.initBoard('jxgbox',{axis:true,originX:300,originY:250,unitX:25,unitY:25}); | var brd = JXG.JSXGraph.initBoard('jxgbox',{axis:true,originX:300,originY:250,unitX:25,unitY:25}); | ||
brd.suspendUpdate(); | brd.suspendUpdate(); | ||
var a = brd.createElement('slider',[[2,8],[6,8],[0,3,6]] | var a = brd.createElement('slider',[[2,8],[6,8],[0,3,6]],{name:'a'}); | ||
var b = brd.createElement('slider',[[2,7],[6,7],[0,2,6]] | var b = brd.createElement('slider',[[2,7],[6,7],[0,2,6]],{name:'b'}); | ||
var A = brd.createElement('slider',[[2,6],[6,6],[0,3,6]] | var A = brd.createElement('slider',[[2,6],[6,6],[0,3,6]],{name:'A'}); | ||
var B = brd.createElement('slider',[[2,5],[6,5],[0,3,6]] | var B = brd.createElement('slider',[[2,5],[6,5],[0,3,6]],{name:'B'}); | ||
var delta = brd.createElement('slider',[[2,4],[6,4],[0,0,Math.PI]] | var delta = brd.createElement('slider',[[2,4],[6,4],[0,0,Math.PI]],{name:'δ'}); | ||
var c = brd.createElement('curve',[ | var c = brd.createElement('curve',[ | ||
Line 23: | Line 23: | ||
var brd = JXG.JSXGraph.initBoard('jxgbox',{axis:true,originX:300,originY:250,unitX:25,unitY:25}); | var brd = JXG.JSXGraph.initBoard('jxgbox',{axis:true,originX:300,originY:250,unitX:25,unitY:25}); | ||
brd.suspendUpdate(); | brd.suspendUpdate(); | ||
var a = brd.createElement('slider',[[2,8],[6,8],[0,3,6]] | var a = brd.createElement('slider',[[2,8],[6,8],[0,3,6]],{name:'a'}); | ||
var b = brd.createElement('slider',[[2,7],[6,7],[0,2,6]] | var b = brd.createElement('slider',[[2,7],[6,7],[0,2,6]],{name:'b'}); | ||
var A = brd.createElement('slider',[[2,6],[6,6],[0,3,6]] | var A = brd.createElement('slider',[[2,6],[6,6],[0,3,6]],{name:'A'}); | ||
var B = brd.createElement('slider',[[2,5],[6,5],[0,3,6]] | var B = brd.createElement('slider',[[2,5],[6,5],[0,3,6]],{name:'B'}); | ||
var delta = brd.createElement('slider',[[2,4],[6,4],[0,0,Math.PI]] | var delta = brd.createElement('slider',[[2,4],[6,4],[0,0,Math.PI]],{name:'δ'}); | ||
var c = brd.createElement('curve',[ | var c = brd.createElement('curve',[ |
Revision as of 14:12, 23 March 2009
Lissajous curve (Lissajous figure or Bowditch curve) is the graph of the system of parametric equations
- [math]\displaystyle{ x=A\sin(at+\delta),\quad y=B\sin(bt). }[/math]
<jsxgraph board="brd" width="600" height="500">
var brd = JXG.JSXGraph.initBoard('jxgbox',{axis:true,originX:300,originY:250,unitX:25,unitY:25});
brd.suspendUpdate();
var a = brd.createElement('slider',[[2,8],[6,8],[0,3,6]],{name:'a'});
var b = brd.createElement('slider',[[2,7],[6,7],[0,2,6]],{name:'b'});
var A = brd.createElement('slider',[[2,6],[6,6],[0,3,6]],{name:'A'});
var B = brd.createElement('slider',[[2,5],[6,5],[0,3,6]],{name:'B'});
var delta = brd.createElement('slider',[[2,4],[6,4],[0,0,Math.PI]],{name:'δ'});
var c = brd.createElement('curve',[
function(t){return A.Value()*Math.sin(a.Value()*t+delta.Value());},
function(t){return B.Value()*Math.sin(b.Value()*t);},
0, 2*Math.PI],{strokeColor:'#aa2233',strokeWidth:3});
brd.unsuspendUpdate();
</jsxgraph>