Discrepancy in a dodekagon

I drew a dodecagon and dissected it.

\documentclass[border=1mm]{standalone}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}[line join=round, scale=2]
\foreach \n in {0,1,...,5}
\coordinate (A\n) at (\n*60:1);
\foreach \n in {0,1,...,11}
\coordinate (B\n) at (\n*30+15:1+3^.5/2);
\fill[cyan] (B3) -- (B4) -- (B5) -- (B6) -- (B7) -- (B8) -- cycle;
\draw (A0)
\foreach \n in {1,2,...,5}{
-- (A\n)
}
-- cycle;
\foreach \n in {0,1,2,...,5}{
\draw (0,0) -- (A\n);
}
\draw (B0)
\foreach \n in {1,2,...,11}{
-- (B\n)
}
-- cycle;
\foreach \x/\y in {0/0, 1/1, 1/2, 2/3, 2/4, 3/5, 3/6, 4/7, 4/8, 5/9, 5/10, 0/11}
\draw (A\x) -- (B\y);
\draw[ultra thick, blue] (A1) circle (.15);
\draw[ultra thick, blue] (A5) circle (.15);
\draw[ultra thick, red] (A2) circle (.15);
\draw[ultra thick, red] (A4) circle (.15);
\end{tikzpicture}
\end{document}


It looked good. But I found something wrong. Can you see them in the red and blue circles?

The boundaries of colored regions must pass the vertices of the hexagon. If you change "(\n*30+15:1+3^.5/2)" to "(\n*30+15:1+3.5^.5/2)", then the boundaries exactly meet the vertices. But, I cannot understand.

The radius of the outer vertices should be 2*cos(15) times the radius of the inner vertices.

\documentclass[border=1mm]{standalone}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}[line join=round, scale=2]
\foreach \n in {0,1,...,5}
\coordinate (A\n) at (\n*60:1);
\foreach \n in {0,1,...,11}
\coordinate (B\n) at (\n*30+15:{2*cos(15)});
\fill[cyan] (B3) -- (B4) -- (B5) -- (B6) -- (B7) -- (B8) -- cycle;
\draw (A0)
\foreach \n in {1,2,...,5}{
-- (A\n)
}
-- cycle;
\foreach \n in {0,1,2,...,5}{
\draw (0,0) -- (A\n);
}
\draw (B0)
\foreach \n in {1,2,...,11}{
-- (B\n)
}
-- cycle;
\foreach \x/\y in {0/0, 1/1, 1/2, 2/3, 2/4, 3/5, 3/6, 4/7, 4/8, 5/9, 5/10, 0/11}
\draw (A\x) -- (B\y);
\draw[ultra thick, blue] (A1) circle (.15);
\draw[ultra thick, blue] (A5) circle (.15);
\draw[ultra thick, red] (A2) circle (.15);
\draw[ultra thick, red] (A4) circle (.15);
\draw[purple] (0,0) -- (B3);
\draw[purple] (120:0.4) arc(120:105:0.4) coordinate[midway] (arc) node[above
right=0.1cm] (15){$15^\circ$};
\draw[purple,-latex] (15.west) to[out=170,in=100] (arc);

\end{tikzpicture}
\end{document}


EDIT: Added illustration in purple. (Note also that 1+sqrt(3.5)/2=1.93541... whereas 2*cos(15)=1.93185..., i.e. it is a numerical accident that 1+sqrt(3.5)/2 works.)

• Or 2*cos(15) = (1 + sqrt(3)) / sqrt(2) – Heiko Oberdiek May 29 '18 at 18:39
• @HeikoOberdiek Sure, thanks! (But I like the left-hand side better since it is shorter and arguably also more direct ;-) – marmot May 29 '18 at 18:41
• @marmot Oh. Sorry. I forgot to accept it by the shock for my foolishness. – P.-S. Park Jun 1 '18 at 10:41