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 5: | Line 5: | ||
var k = brd.create('slider',[[-1,1.4],[1,1.4],[1,1,11]], {name:'k', snapWidth:1}); | var k = brd.create('slider',[[-1,1.4],[1,1.4],[1,1,11]], {name:'k', snapWidth:1}); | ||
var p = brd.create('curve',[function(phi, suspendUpdate){ | |||
var kk, aa, bb; | |||
if (!suspendUpdate) { | |||
aa = a.Value(); | |||
bb = b.Value(); | |||
kk = k.Value(); | |||
} | |||
var co = Math.cos(kk*phi*0.5); | |||
return aa*co*co+bb; | |||
}, 0,Math.PI*2]); | |||
</jsxgraph> | </jsxgraph> | ||
[[Category:Examples]] | [[Category:Examples]] | ||
[[Category:Curves]] | [[Category:Curves]] |