[Tex/LaTex] TikZ: Fill (closed) parametric plot of catacaustic

gnuplotplottikz-pgf

Is there a trick to fill the parametric plot of a catacaustic which looks closed but isn’t closed in TiKZ meaning. The Problem is the egdge which looks closed but isn’t it …

problem

I guess I can experiment with overlay a withe area or try to clip with a limited second plot using the even odd rule but I hope theres a more comfortable way to to this.

Code

% needs gnuplot
\documentclass{minimal}

\usepackage{tikz}
\tikzset{samples=500}

\begin{document}
\begin{tikzpicture}
    \draw [thick, fill=red] plot [id=op-12,parametric]
        function{2*cos(t)-cos(2*t),2*sin(t)-sin(2*t)};
    \draw [<-] (1.5,0) -- +(1.5,0) node [right] {Problem};
\end{tikzpicture}
\end{document}

Best Answer

Change the domain to 0:2*pi:

enter image description here

\documentclass{article}

\usepackage{tikz}
\tikzset{samples=500}

\begin{document}
\begin{tikzpicture}
    \draw [thick, fill=red,domain=0:2*pi] plot 
        ({2*cos(\x r)-cos(2*\x r)},{2*sin(\x r)-sin(2*\x r)});
\end{tikzpicture}
\end{document}

(I haven't used Gnuplot because it's not necessary here.)

Related Question