# Polar plot

The polar coordinates $r$ and $\theta$ can be converted to the Cartesian coordinates $x$ and $y$ using the trigonometry functions:

$\begin{cases} x=r\cdot\cos(\theta) \\ y=r\cdot\sin(\theta)\end{cases}$

It follows that a figure specified in $(r, \theta)$ can be plotted by ‘plot2d’ as a parametric curve:

Fig. 1 $r = \cos(5\theta)$

It is possible to plot two or more parametric curves together:

Fig. 2 $r=\theta$ and $r=\cos(5\theta)$

An alternate is the ‘draw2d’ function, it draws graphic objects created by the ‘polar’ function:

Fig. 3 $r=\theta$ and $r=\cos(5\theta)$

Fig. 4 shows a graceful geometric curve that resembles a butterfly. Its equation is expressed in polar coordinates by

$r = e^{\sin(\theta)} - 2\cos(4\theta)+\sin(\frac{\theta}{12})^5$

Fig. 4