Lituus: Difference between revisions

From JSXGraph Wiki
No edit summary
No edit summary
Line 2: Line 2:
  b2 = JXG.JSXGraph.initBoard('box2', {originX: 250, originY: 250, unitX: 25, unitY: 25});
  b2 = JXG.JSXGraph.initBoard('box2', {originX: 250, originY: 250, unitX: 25, unitY: 25});
  var k1 = b2.createElement('slider', [[1,8],[5,8],[0,2,8]]);
  var k1 = b2.createElement('slider', [[1,8],[5,8],[0,2,8]]);
  var len = b2.createElement('slider', [[1,7],[5,7],[1,2,4]]);
  var len = b2.createElement('slider', [[1,7],[5,7],[1,2,3.2]]);
  var c = b2.createElement('curve',  
  var c = b2.createElement('curve',  
             [function(t){ return k1.Value()*b2.I([0,t],function(u){return Math.sin(u*u*0.5);}); },  
             [function(t){ return k1.Value()*b2.I([0,t],function(u){return Math.sin(u*u*0.5);}); },  
               function(t){ return k1.Value()*b2.I([0,t],function(u){return Math.cos(u*u*0.5);}); },
               function(t){ return k1.Value()*b2.I([0,t],function(u){return Math.cos(u*u*0.5);}); },
            0, function(){return len.Value()*Math.PI;}],
              function(){return -len.Value()*Math.PI;}, function(){return len.Value()*Math.PI;}],
             {strokewidth:1});       
             {strokewidth:1});       
</jsxgraph>
</jsxgraph>

Revision as of 08:28, 18 March 2009


A lituus is a spiral in which the angle is inversely proportional to the square of the radius (as expressed in polar coordinates).

[math]\displaystyle{ r^2\theta = k \, }[/math]

The JavaScript code to produce this picture

<jsxgraph width="500" height="500" box="box1">
 var b1 = JXG.JSXGraph.initBoard('box1', {axis:true,originX: 250, originY: 250, unitX: 25, unitY: 25});
 var k = b1.createElement('slider', [[1,8],[5,8],[0,1,4]]);
 var c = b1.createElement('curve', [function(phi){return Math.sqrt(k.Value()/phi); }, [0, 0],0, 8*Math.PI],
             {curveType:'polar', strokewidth:4});      
</jsxgraph>

External links