How would I create a TikZ picture of the limaçon $r=0.5+\cos(\theta)$?

Would I have to convert it to cartesian coordinates or is there a way to plot the polar form?

  • If you're graphing in a cartesian system, see this. – David Mitra May 28 '15 at 20:45

Hopefully the following Minimal Working Solution can answer your problem best.



\begin{polaraxis}[enlargelimits=false, xticklabel=$\pgfmathprintnumber{\tick}^\circ$]
\addplot [thick, red, domain=0:360, samples=100] {.5+cos(x)};

enter image description here

| improve this answer | |

For those who are interested, here is a MetaPost version of Friendly Ghost's nice answer. I've found it an interesting exercise to reproduce it. It uses a plr_function macro defined in the preamble, which draws the plot of a polar function given as argument.

The MetaPost code has been inserted in a LuaLaTeX program here (MetaPost being kind of integrated into LuaTeX), but it is by no means necessary: it is only easier to typeset it this way, since not everyone knows how to run standalone MetaPost.

\usepackage{gensymb, luamplib}
  \everymplib{u := 2cm;
    vardef plr_function(expr tmin, tmax, tstep)(text f_t) =
      save t; t := tmin;
      (f_t)*dir t forever: hide(t := t + tstep) exitif t > tmax; 
        .. (f_t)*dir t endfor
        if t - tstep < tmax: hide(t := tmax) .. (f_t)*dir t fi
     for i =  1 upto 3:
       draw fullcircle scaled (i*u) withcolor .8white;
       label.bot("$" & decimal .5i & "$", (.5i*u, 0));
     for i = 0 upto 11:
       draw origin -- 1.6u*dir 30i withcolor .8white;
       freelabel("$" & decimal 30i & "\degree$", 1.6u*dir 30i, origin);
     draw plr_function(0, 360, 1)(.5 + cosd t) scaled u withcolor red;


enter image description here

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.