8

This blog shows some math parametrized functions that can be used to "plot" symmetric leaves like the one below:

enter image description here

Is it possible to implement such functions and draw the leaf using TikZ?

egreg
  • 1,121,712
Epa
  • 3,449

2 Answers2

18

Oak Leaf only with basic function of Tikz

\documentclass{article}
\usepackage[margin=2cm]{geometry}

\usepackage{tikz}
\begin{document}

\begin{tikzpicture}
\draw[scale=3,domain=0:180,variable=\t, samples=500]
plot (%
{1/100*(cos(\t))^9*(cos(5*\t))^10 +1/4*sin(2*\t)*(1-1/2*(sin(10*\t))^2)*(1-(cos(\t)*cos(3*\t))^8)
},{
sin(\t)*(1-1/5*(sin(10*\t)^2*(1/2+(sin(2*\t)^2)
});
\end{tikzpicture}
\end{document}

enter image description here

rpapa
  • 12,350
11

Simply based on rpapa's answer and the formulas in the question, here is a working .tex file which can be compiled with pdflatex:

\documentclass{article}
\usepackage[margin=2cm]{geometry}

\usepackage{tikz}
\begin{document}

\begin{tikzpicture}
\draw[scale=3, domain=0:180, variable=\t, samples=500, fill=red]
plot (%
{
(
1
+
(cos(6*\t))^2
+
(1/5)*(cos(6*\t)*cos(24*\t))^10
+
( (1/4)*(cos(30*\t))^2 + (1/9)*(cos(30*\t))^12) *  (1-(sin(6*\t))^10)
)
*(sin(2*\t))
*(1-(cos(\t))^4)
*(1 - (cos(\t))^10 * (cos(3*\t))^2)
+(1/70)*(cos(\t))^9
}
,
{
(-21/20)*cos(2*\t)*(1 - (cos(\t))^4 + (1/2)*(cos(\t)*cos(3*\t))^10)
*
(
1
+
(cos(6*\t))^2
+
(1/5)*(cos(6*\t)*cos(18*\t))^10
+
( (1/4)*(cos(30*\t))^4 + (1/10)*(cos(30*\t))^12 )
*
( 1 - ((cos(\t))^10) * (cos(3*\t))^2 )
*
( 1 - (sin(6*\t))^10 )
)
}
);
\end{tikzpicture}
\end{document}

I left in my original line-breaks and potentially unnecessary parentheses.

Notes:

I recommend qtikz or ktikz on GNU/Linux to easily preview TikZ pictures.

Also, when copying the formulas, make sure to always add a "*" between numbers and "\t". I am not sure why it is necessary, but TikZ seems to read things like "6\t" wrong without giving any errors.

Maple leaf generated with TikZ

red Maple leaf generated with TikZ

KIAaze
  • 410