I would like to place rectangles on a circular path, in a way that they are tangential to the circle.

If I use polar coordinates and connected lines, I end up with something like this: enter image description here

I want the rectangular sections to stay truly rectangular. If I use the rectangle command together with the rotate option, I have troubles placing the rectangles along a circular path.

Is it possible to use the rectangle command with polar coordinates?

Edit: My poor attempt was the following:

\foreach \a in {0, 45, 90, 135, 180}{
\path[draw] (\a:1) -- (\a:2) -- (\a + 10:2) -- (\a + 10:1) -- cycle;
  • 1
    Welcome to TeX.SX! Please help us help you and add a minimal working example (MWE) that illustrates your problem. Reproducing the problem and finding out what the issue is will be much easier when we see compilable code, starting with \documentclass{...} and ending with \end{document}. – LaRiFaRi Sep 7 '15 at 9:56
\documentclass[tikz, border=2mm]{standalone}



\draw circle (3cm);

\draw (30:3cm) node[draw, anchor=south, rotate=-60, minimum width=1cm] {A};

\draw (60:3cm) node[draw, anchor=south, rotate=-30, minimum width=1cm] {B};

\draw (215:3cm) node[draw, anchor=south, rotate=125, minimum width=1cm] {C};


enter image description here

  • I did not know about minimum width/minimum height parameters, which apparently lets you create arbitrary rectangles. :D – circularpath2 Sep 7 '15 at 10:13

I think this does it:

  \r = 1;
  \a = 10; % angle of chord forming base of rectangle
  \s = 15; % angle between rectangle centers 
  \R = \r * cos(\s / 2);
  \n = int(360 / \s);
  \x = \r / 2 * sin(\a);

\draw [help lines] circle [radius=\r];
\foreach \i in {1, ..., \n}
  \draw [help lines] 
    (0,0) -- (\i*\s-\a/2:\r+1/2) (0,0) -- (\i*\s+\a/2:\r+1/2);

\foreach \i in {1, ..., \n}
  \draw [shift=(\i*\s:\R),rotate=\i*\s+270] 
    (-\x, 0) rectangle (\x, 1/8);

enter image description here


You can use a \foreach loop to draw rectangles around a circle.



   rectangle node/.style={
      minimum width = \w,
      minimum height = \h,
      fill = gray,
      inner sep = 0pt,
      anchor = center,
   % Variables
   \def\N{36}% Number of rectangles - 1
   \def\h{0.2cm}% height of rectangles
   \def\w{0.4cm}% width of rectangles
   \def\R{3}% Radius
   % draw rectangles
   \foreach \n in {0,...,\N} {
      \node [rectangle node, rotate=\n*(360/(\N+1))+90] at ({\n*360/(\N+1)}:\R) {};

I defined some variables to set the size of the rectangles (\w and \h), the number of rectangles (\N+1) and the radius of the circle (\R).

rectangles in a circle

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.