Contents

Drawing a Rose Curve with TikZ in LaTeX

The rose curve is one of the most visually beautiful mathematical curves. It was first studied in depth by the Italian mathematician Guido Grandi in 1725. Its flower-petal-like shape makes it a favorite in mathematical art and decorative design.

This article discusses the mathematical analysis of the rose curve and the LaTeX TikZ coding technique to draw it, complete with source code, compiled output, and experiments with different petal counts.

The rose curve is defined in polar coordinates by the general equation:

r=acos(kθ)orr=asin(kθ)r = a\cos(k\theta) \quad \text{or} \quad r = a\sin(k\theta)

where:

  • aa = amplitude (maximum petal length from the center),
  • kk = constant that determines the number of petals,
  • θ\theta = polar angle (0θ3600^\circ \leq \theta \leq 360^\circ).

The number of petals is determined by the value of kk:

  • If kk is odd → the curve has kk petals (e.g., k=5k = 5 → 5 petals),
  • If kk is even → the curve has 2k2k petals (e.g., k=8k = 8 → 16 petals).

In this article we use r=acos(kθ)r = a\cos(k\theta) with a=2.9a = 2.9 cm, and vary kk to obtain different rose shapes.

Here is the complete TikZ code to draw a rose with k=5k = 5:

\documentclass[tikz,border=10pt]{standalone}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
  \draw[very thick, red!75!black, domain=0:360, samples=600, variable=\t]
    plot ({2.9*cos(5*\t)*cos(\t)}, {2.9*cos(5*\t)*sin(\t)});
\end{tikzpicture}
\end{document}

The code above was compiled with the Tectonic engine (XeLaTeX-based), producing the following image:

Rose curve with 5 petals (k = 5)

A rose with 5 petals because k=5k = 5 (an odd number). The petals are symmetrically arranged around the center, resembling a perfectly bloomed flower.

Let us break down the code line by line:

\documentclass[tikz,border=10pt]{standalone}

The standalone class crops the output tightly to the drawing (no full page), with a 10pt margin. The tikz option loads the core TikZ library automatically.

\draw[very thick, red!75!black, domain=0:360, samples=600, variable=\t]
  plot ({2.9*cos(5*\t)*cos(\t)}, {2.9*cos(5*\t)*sin(\t)});

The key parts of this command:

OptionPurpose
domain=0:360The angle range θ\theta from 0° to 360° (one full revolution)
samples=600Number of points computed along the curve — the more, the smoother
variable=\tDefines the angle variable θ\theta as \t
plot ({...}, {...})Computes Cartesian coordinates from polar coordinates

A polar point (r,θ)(r, \theta) is converted to Cartesian coordinates by:

x=rcosθ,y=rsinθx = r\cos\theta, \qquad y = r\sin\theta

Since r=2.9cos(5θ)r = 2.9\cos(5\theta), we have:

x=2.9cos(5θ)cosθ,y=2.9cos(5θ)sinθx = 2.9\cos(5\theta)\cos\theta, \qquad y = 2.9\cos(5\theta)\sin\theta

This is exactly what is written in the plot expression above. Note that TikZ trigonometric functions work in degrees, so domain=0:360 directly corresponds to one full revolution.

The beauty of the rose curve is that we can change its shape simply by changing the value of kk. Here are some variations:

\draw[very thick, blue!75!black, domain=0:360, samples=600, variable=\t]
  plot ({2.9*cos(3*\t)*cos(\t)}, {2.9*cos(3*\t)*sin(\t)});

Rose curve with 3 petals (k = 3)

k=3k = 3 (odd) produces 3 wider petals.

\draw[very thick, green!60!black, domain=0:360, samples=600, variable=\t]
  plot ({2.9*cos(7*\t)*cos(\t)}, {2.9*cos(7*\t)*sin(\t)});

Rose curve with 7 petals (k = 7)

k=7k = 7 produces 7 slimmer, tighter petals.

\draw[very thick, orange!80!black, domain=0:360, samples=800, variable=\t]
  plot ({2.9*cos(8*\t)*cos(\t)}, {2.9*cos(8*\t)*sin(\t)});

Rose curve with 16 petals (k = 8)

Since k=8k = 8 is even, the curve has 2k=162k = 16 petals. The petals are denser, so the number of samples is increased to 800 to keep the curve smooth.

Drawing a rose curve with TikZ turns out to be very simple — just a single \draw command with plot and a bit of trigonometry. The key is understanding the conversion from polar to Cartesian coordinates:

x=rcosθ,y=rsinθx = r\cos\theta, \qquad y = r\sin\theta

By varying the value of kk and the color, we can produce a wide range of attractive flower shapes, from 3 petals to dozens of petals. This curve is well suited for practicing trigonometric function graphs, polar coordinates, or simply creating mathematical art in LaTeX.

  1. Wikipedia, Rose (mathematics)https://en.wikipedia.org/wiki/Rose_(mathematics)
  2. TikZ & PGF Manual — https://tikz.dev
  3. Related article on this blog: Drawing a Sunflower Pattern (Phyllotaxis) with TikZ

Related Content