# Christmas Star

Ron Gerber sent me the same image, which he produced using my C.a.R. geometry program. I though Euler Math Toolbox might be a better choice. So I reproduced his image with EMT.

First of all, the command necessary for this are very few.

>x=mod((0:1:360)*31,360)°;
>fullwindow;
>plot2d(cos(4*x)*cos(x),cos(4*x)*sin(x),grid=0,thickness=0.5):

That’s it. The trick is based on the curve

$$\gamma(x) = \cos(4x) \, \left(\cos(x),\sin(x)\right), \quad x \in [0,2\pi].$$

The curve is divided into 360 points, and every 31th point is connected with a line segment. These segments yield the beautiful polar sets you see in the image above. Here, you see the 360 points.

Ron also tried some more parameters for this kind of curves. First we can use the basic curve

$$\gamma(x) = \cos(mx)^a \, \left(\cos(x),\sin(x)\right), \quad x \in [0,2\pi].$$

Then we can use every r-th point. Instead of r=31, every number without a common divisor to 360 makes sense. Using this and C.a.R., he produced a lot of nice stars.

In Euler, you can drag values too. The function to use is dragvalues(). It needs a drawing routine, which takes a vector of parameters. After the user interaction, it returns the current values. We use it draw the final choice of the user and insert the result into the notebook.

>function plotstar ([m,e,r]) ...
$fullwindow();$  x=mod((0:1:360)*r,360)°;
$plot2d(cos(m*x)^e*cos(x),cos(m*x)^e*sin(x),grid=0,thickness=0.5);$endfunction
>v=dragvalues("plotstar",["M","E","R"], ...
>   [4,1,31],[0,12;1,10;1,50], ...
>   stops=[12,9,49],digits=0, ...
>plotstar(v):