\section{Courbes en coordonnées polaires}

\begin{NewMacroBox}{tkzFnPolar}{\oarg{options}\marg{$\rho(t)$}}
\emph{$\rho(t)$ est une expression Lua de la variable \texttt{t} ; le point tracé a pour coordonnées $\big(\rho(t)\cos t~;~\rho(t)\sin t\big)$. Les bornes du domaine sont des expressions Lua : \texttt{pi} représente $\pi$.}

\begin{tabular}{lll}
\toprule
options             & défaut & définition                         \\
\midrule
\TOline{domain}{0:2*pi}{intervalle des valeurs de $t$}
\TOline{samples}{200}{nombre de points}
\TOline{clip}{false}{la courbe est découpée à la fenêtre}
\bottomrule
\end{tabular}

\emph{Les autres options sont celles de \TIKZ.}
\end{NewMacroBox}

\subsection{Équation polaire exemple 1}

$ \rho(t)= \cos(t)\sin(t) $

\begin{tkzexample}[latex=8cm]
\begin{tikzpicture}[scale=0.75]
 \tkzFnInit[xmin=-0.5,xmax=0.5,
            ymin=-0.5,ymax=0.5,
            xstep=0.1,ystep=.1]
 \tkzFnAxes[ticks=false]
 \tkzFnPolar[domain=-2*pi:2*pi]{cos(t)*sin(t)}
\end{tikzpicture}
\end{tkzexample}

\subsection{Équation polaire exemple 2}
$ \rho(t)= \cos(2t)  $

\begin{center}
\begin{tkzexample}[]
\begin{tikzpicture}[scale=1.25]
   \tkzFnInit[xmin=-1,xmax=1,
              ymin=-1,ymax=1,
              xstep=.2,ystep=.2]
  \tkzFnAxes[ticks=false]
  \tkzFnPolar[domain=0:2*pi]{cos(2*t)}
\end{tikzpicture}
\end{tkzexample}
\end{center}

\newpage
\subsection{Équation polaire : cœur}
From Mathworld :  \url{http://mathworld.wolfram.com/HeartCurve.html}

 $\rho(t)= 2-2\sin(t)+\sin(t)\dfrac{\sqrt{\lvert\cos(t)\rvert}}{\sin(t)+1.4}$

\begin{center}
\begin{tkzexample}[]
\begin{tikzpicture}[scale=.6]
  \tkzFnInit[xmin=-5,xmax=5,ymin=-5,ymax=5]
  \tkzFnPolar[domain=-pi:pi,
              samples=800,
              ball color=red,
              shading=ball]
    {2-2*sin(t)+sin(t)*sqrt(abs(cos(t)))/(sin(t)+1.4)}
\end{tikzpicture}
\end{tkzexample}
\end{center}

\subsection{Équation polaire exemple 4}
 $\rho(t)= 1-\sin(t)$

\begin{center}
\begin{tkzexample}[]
\begin{tikzpicture}[scale=1]
 \tkzFnInit[xmin=-5,xmax=5,ymin=-5,ymax=5]
 \tkzFnPolar[domain=0:2*pi,samples=400]{1-sin(t)}
\end{tikzpicture}
\end{tkzexample}
\end{center}

\newpage
\subsection{Équation polaire : Cannabis curve}
 Cannabis curve from mathworld : \url{http://mathworld.wolfram.com/CannabisCurve.html}

$ \rho(t)=(1+0.9\cos(8t))(1+0.1\cos(24t))(1+0.1\cos(200t))(1+\sin(t)) $

\begin{center}
\begin{tkzexample}[vbox]
\begin{tikzpicture}[scale=2]
  \tkzFnInit[xmin=-5,xmax=5,ymin=-5,ymax=5]
  \tkzFnPolar[domain=0:2*pi,samples=2000]
  {(1+.9*cos(8*t))*(1+.1*cos(24*t))*(1+.1*cos(200*t))*(1+sin(t))}
\end{tikzpicture}
\end{tkzexample}
\end{center}

\newpage
\subsection{Scarabaeus curve}
From mathworld : \url{http://mathworld.wolfram.com/Scarabaeus.html}

$\rho(t)=1.6\cos(2t)-3\cos(t) $

\begin{center}
\begin{tkzexample}[]
\begin{tikzpicture}[scale=1]
  \tkzFnInit[xmin=-5,xmax=5,ymin=-5,ymax=5]
  \tkzFnPolar[domain=0:2*pi,samples=400]{1.6*cos(2*t)-3*cos(t)}
\end{tikzpicture}
\end{tkzexample}
\end{center}

\endinput
