The goal: Make a polygon (and a circle containing that polygon at the nodes of the polygon, without the polygon's lines) with automatically numbered nodes according to their coordinates (x,y) [which latex must calculate] or unique names.
[EDIT: I have added a different MWE (Ignasi's), to clarify, since it does away with two macros in my old MWE at expense of one option. In this example: how does one control the size of the dots on the nodes [the option lost], and to make (x,y) coordinate positions of the nodes their visible labels, as per title of the question?]
Of course,
\node (n1) at (x,y) {$1$};
or
\node (n1) at (x,y) {$\boldsymbol{W_1(z)}$};
or
\node (n1) at (x,y) {$(x,y)$};
could be done manually on top any figure otherwise made but for more many nodes makes for long code and lots of guessing where (x,y) the nodes on the circle or polygon actually are.
!!! The labels should preferably all be away from the lines of the nodes, like here: Drawing a regular polygon encompassed by a circle
MWE(Ignasi):
\documentclass{minimal}
\usepackage{amsmath}
\usepackage{tikz}
\usetikzlibrary{calc}
\usetikzlibrary{shapes.geometric}
\begin{document}
\begin{tikzpicture}[scale=1]
\foreach \a in {4,...,5}
{
\draw[blue, solid, line width = 1mm] (\a*7,0) circle(3cm);
\node[regular polygon,
regular polygon sides=\a,
minimum size=6cm,
draw] at (\a*7,0) (A) {};
\foreach \i in {1,...,\a}
\node[circle,
label=above:{$w_\i(z)$},
fill=red] at (A.corner \i) {};
}
\end{tikzpicture}
\end{document}
MWE(old):
\documentclass{minimal}
\usepackage{amsmath}
\usepackage{tikz}
\usetikzlibrary{calc}
\begin{document}
%POLYGON command
\newcommand{\polygon}[2]{%
let \n{len} = {2*#2*tan(360/(2*#1))} in
++(0,-#2) ++(\n{len}/2,0) \foreach \x in {1,...,#1} { -- ++(\x*360/#1:\n{len})}}
%DOTS command
\makeatletter
\tikzset{
dot diameter/.store in=\dot@diameter,
dot diameter=3pt,
dot spacing/.store in=\dot@spacing,
dot spacing=7pt,
dots/.style={
line width = \dot@diameter,
line cap = round,
dash pattern = on 0pt off \dot@spacing}
}\makeatother
%BEGIN
\begin{tikzpicture}
\node (n1) at (-2,-2) {$\boldsymbol{0}$};
\draw[black, dot diameter=3pt, dot spacing=40pt, dots] (0,0) circle (2);
\draw[black, solid, line width=0.5mm] (5,0) \polygon{9}{2};
\draw[black, solid, line width=0.5mm] (10,0) circle (2);
\end{tikzpicture}
%figure out how to automatically number nodes
\end{document}
shapes.geometric
library?