Polynomial curve of constant width: Difference between revisions
From JSXGraph Wiki
A WASSERMANN (talk | contribs) No edit summary |
A WASSERMANN (talk | contribs) No edit summary |
||
Line 1: | Line 1: | ||
<jsxgraph width="600" height="600"> | <jsxgraph width="600" height="600"> | ||
var brd = JXG.JSXGraph.initBoard('jxgbox',{boundingbox:[-2,2,2,-2], keepaspectratio:true}); | var brd = JXG.JSXGraph.initBoard('jxgbox',{boundingbox:[-2,2,2,-2], keepaspectratio:true}); | ||
var a = brd.create('slider',[[-1,1.8],[1,1.8],[-5, | brd.suspendUpdate(); | ||
var b = brd.create('slider',[[-1,1.6],[1,1.6],[-5, | var a = brd.create('slider',[[-1,1.8],[1,1.8],[-5,2,5]], {name:'a'}); | ||
var k = brd.create('slider',[[-1,1.4],[1,1.4],[1, | var b = brd.create('slider',[[-1,1.6],[1,1.6],[-5,8,10]], {name:'b'}); | ||
var k = brd.create('slider',[[-1,1.4],[1,1.4],[1,3,11]], {name:'k', snapWidth:1}); | |||
var p = brd.create('curve',[function(phi, suspendUpdate){ | var p = brd.create('curve',[function(phi, suspendUpdate){ | ||
Line 14: | Line 15: | ||
var co = Math.cos(kk*phi*0.5); | var co = Math.cos(kk*phi*0.5); | ||
return aa*co*co+bb; | return aa*co*co+bb; | ||
},[0,0], 0,Math.PI*2], {curveType:'polar'}); | },[0,0], 0,Math.PI*2], {curveType:'polar', strokeWidth:6, strokeColor:'#3d1c24'}); | ||
brd.unsuspendUpdate(); | |||
</jsxgraph> | </jsxgraph> | ||
[[Category:Examples]] | [[Category:Examples]] | ||
[[Category:Curves]] | [[Category:Curves]] |