# How to draw all (or some) symmetries axes of a regular polygon

Is there a systematic way to draw all symmetries axes of a regular polygons (with dashed lines)? Here is a document. I would like to have an output like this:

For n=5:

For n=6:

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{shapes.geometric, calc}

\begin{document}

\begin{tikzpicture}[scale=3]
\node (a)
[draw,  blue!0!black,rotate=90,minimum size=3cm,regular polygon, regular polygon sides=5] at (0, 0) {};

\foreach \x in {1,2,..., 5}
\end{tikzpicture}

\begin{tikzpicture}[scale=3]
\node (a)
[draw,  blue!0!black,rotate=90,minimum size=3cm,regular polygon, regular polygon sides=6] at (0, 0) {};

\foreach \x in {1,2,..., 6}
\end{tikzpicture}

\end{document}


You can use center and side anchors with corner anchor for a polygon.

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{shapes.geometric, calc}

\begin{document}

\begin{tikzpicture}[scale=3]
\def\rps{7} % regular polygon sides
\node (a)
[draw,  blue!0!black,rotate=90,minimum size=3cm,regular polygon, regular polygon sides=\rps] at (0, 0) {};

\foreach \x in {1,2,...,\rps}
\foreach \x in {1,2,...,\rps}{
\draw [red,dashed, shorten <=-0.5cm,shorten >=-0.5cm](a.center) -- (a.side \x);
\draw [red,dashed, shorten <=-0.5cm,shorten >=-0.5cm](a.center) -- (a.corner \x);}

\end{tikzpicture}
\end{document}


For n=3

For n=4

For n=7

\documentclass[pstricks,preview,border=5mm]{standalone}
\usepackage{pst-node,pst-plot}

\def\N{10}
\degrees[\N]

\begin{document}
\makeatletter
\begin{pspicture}(-4,-4)(4,4)
\pstVerb{/offset 30 def}%
\curvepnodes[plotpoints=\numexpr\N+1\relax]{0}{\N}{3 t \pst@angleunit offset add PtoC}{A}
\psnline[showpoints](0,\N){A}
\multido{\i=0+1}{\N}{\pcline[nodesepB=-10mm,linestyle=dashed,linecolor=red](0,0)(A\i)}
\end{pspicture}
\makeatother
\end{document}


• Thanks, this works with xelatex. Is there a reason that it does not work with pdflatex? – Name May 24 '17 at 10:30
• You can use pdflatex as well but load auto-pst-pdf package. – Money Oriented Programmer May 24 '17 at 16:15