# Difference between revisions of "Polynomial curve of constant width"

From JSXGraph Wiki

Jump to navigationJump to searchA WASSERMANN (talk | contribs) |
A WASSERMANN (talk | contribs) |
||

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]] |