Asked
Active
Viewed 490 times
-1
Andrea Leo
- 1,011
1 Answers
4
As I alluded to, you basically only have to copy an example from section 22.5 in the manual for TikZ and replace the equations with the ones you want. In the first example note that the r indicates that radians should be used, by default the trigonometric functions in pgf uses degrees.
I also added an example with pgfplots, which is convenient if you need axes.
\documentclass[border=4mm]{standalone}
\usepackage{pgfplots} % also loads tikz
\begin{document}
\begin{tikzpicture}
\draw[domain=0:pi,variable=\t,samples=200]
plot ({cos(\t r)^2*(-1 + 4*sin(\t r)^2)},{cos(\t r)*sin(\t r)*(-1 + 4*sin(\t r)^2)});
\end{tikzpicture}
\begin{tikzpicture}
\begin{axis}[
axis lines=middle,
trig format=rad,
domain=0:pi,
samples=200,
width=4cm,
axis equal]
\addplot [black] ({cos(x)^2*(-1 + 4*sin(x)^2)},{cos(x)*sin(x)*(-1 + 4*sin(x)^2)});
\end{axis}
\end{tikzpicture}
\end{document}
Torbjørn T.
- 206,688
-
Thank you so much! The problem is that I can't figure out why the package pgfplots '' is not found ''.. – Andrea Leo Apr 16 '16 at 20:33
-
@AndreaLeo Because it's not installed presumably. Anyway, if all you need is the trefoil itself, use the first example, and replace
pgfplotswithtikz. – Torbjørn T. Apr 16 '16 at 20:40


pgfmanual.pdfhelps. – Torbjørn T. Apr 15 '16 at 09:53tikzpictureenvironment now. Or, if not, then the answers provided to your other questions have not been of much help to you. – cfr Apr 15 '16 at 12:07