# Polynomial curve of constant width

The curve with support defined by

$\displaystyle{ p(\phi)= a\cdot \cos^2(k\cdot\phi/2)+b }$

has constant width for odd values of $\displaystyle{ k }$. It defines the parametric curve

$\displaystyle{ x(\phi) = p(\phi)\cos(\phi) - p'\sin(\phi) }$
$\displaystyle{ y(\phi) = p(\phi)\sin(\phi) + p'\cos(\phi) }$

In the visualization with JSXGraph below $\displaystyle{ k }$ is determined

$\displaystyle{ k = 2k'+1. }$

### The underlying JavaScript code

var brd = JXG.JSXGraph.initBoard('jxgbox',{boundingbox:[-8,8,8,-8], keepaspectratio:true});
brd.suspendUpdate();
var a = brd.create('slider',[[-1,1.8],[1,1.8],[-5,0.20,5]], {name:'a'});
var b = brd.create('slider',[[-1,1.6],[1,1.6],[-5,1.15,10]], {name:'b'});
var k = brd.create('slider',[[-1,1.4],[1,1.4],[1,1,11]], {name:'k\'', snapWidth:1});

var c = brd.create('curve',[function(phi){
var kk, aa, bb, p, ps, co, si;
aa = a.Value();
bb = b.Value();
kk = 2*k.Value()+1;
co = Math.cos(kk*phi*0.5);
si = Math.sin(kk*phi*0.5);
p  =  aa*co*co+bb;
ps = -aa*kk*co*si;
return p*Math.cos(phi)-ps*Math.sin(phi);
},
function(phi){
var kk, aa, bb, p, ps, co, si;
aa = a.Value();
bb = b.Value();
kk = 2*k.Value()+1;
co = Math.cos(kk*phi*0.5);
si = Math.sin(kk*phi*0.5);
p  =  aa*co*co+bb;
ps = -aa*kk*co*si;
return p*Math.sin(phi)+ps*Math.cos(phi);
},