5

I would like to define a series of dots distributed around a circle and be able to define the number of points using tikz. Is it possibile without involving pstricks?

\documentclass{article}
\usepackage{tikz}

\begin{document}

\begin{tikzpicture}
\draw [draw=red, line width=2pt,dash pattern=on 5pt off 5pt] circle(5cm);
\end{tikzpicture}

\end{document}

enter image description here

FlyBob
  • 169

2 Answers2

4

Something like this --replace black color with red

\documentclass[tikz,border=0.5cm]{standalone}
\begin{document}
\begin{tikzpicture}

\foreach \i in {0,5,10,15,20,25,30,...,360}{% 
\filldraw [black]  (\i:3cm) circle (0.4pt);}
\end{tikzpicture}
\end{document}

enter image description here

EDIT

Circle centre defined at coord (0,0) and given the name {a}

enter image description here

\documentclass{article}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\node (0,0){a};
\foreach \i in {0,5,10,15,20,25,30,...,360}{% 
\filldraw [red]  (\i:3cm) circle (0.4pt);}
\end{tikzpicture}
\end{document}

To reduce the number of dots in the circle simply reduce the number of the angles to 45--90--360 as below

enter image description here

\documentclass{article}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\node (0,0){a};
\foreach \i in {0,45,90,...,360}{% 
\filldraw [blue]  (\i:3cm) circle (1pt);}
\end{tikzpicture}
\end{document}
js bibra
  • 21,280
4

Here is my proposition (with comments):

\documentclass[tikz]{standalone}
\begin{document}
\begin{tikzpicture}
  \coordinate (c) at (12,3);  % center of circle
  \def\radius{6cm}            % radius of circle
  \def\nbpts{400}             % nb of points
  \def\radpt{.5pt}            % radius of points
  \colorlet{point color}{red} % color of points

  \foreach \numpt in {1,...,\nbpts}{
    \fill[point color] (c) ++ (360/\nbpts*\numpt:\radius) circle(\radpt);
  }
\end{tikzpicture}
\end{document}

enter image description here

Paul Gaborit
  • 70,770
  • 10
  • 176
  • 283