3
\documentclass{article}
\usepackage{graphicx} % Required for inserting images
\usepackage{tikz}


\begin{document}

\begin{figure}
    \begin{tikzpicture}
        % Draw the line
        \draw (0,0) -- (6,0);
        
        % Draw the number 1 at the beginning
        \draw (0,-0.1) -- (0,0.1) node[above] {1};
    
        % Draw the number 2
        \draw (1,-0.1) -- (1,0.1) node[above] {2};
    
        % Draw ellipses
        \node at (3,0.1) {$\dots$};
        
        % Draw the point N at the right end
        \draw (6,-0.1) -- (6,0.1) node[above] {N};
    
        % Draw arrow connecting the diagrams
        \draw[->] (7.25,0) -- (7.75,0);
    
        % Draw a circle to the right of the number line with numbers
        \draw (11, 0) circle (1.5);
    
        % Define the positions for the numbers
        \coordinate (1) at (11, 1.5); % Top
        \coordinate (2) at (12, 1.118); % Slightly to the right
        \coordinate (N) at (10, 1.118); % Slightly to the left
    
        % Draw the ticks on the circle
        \draw (11, 1.5-0.1) -- (11, 1.5+0.1) node[above] {1};
        \draw (12, 1.118-0.1) -- (12, 1.118+0.1) node[above] {2};
        \draw (10, 1.118-0.1) -- (10, 1.118+0.1) node[above] {N};
        
    \end{tikzpicture}
\end{figure}

\end{document}

enter image description here

How do I make sure that the ticks intersect the circle perpendicularly? I also want to add the red dots that go around the circle as indicated in the image.

2 Answers 2

6

I use \foreach to place the nodes in polar coordinates.

\documentclass{article}
\usepackage{graphicx} % Required for inserting images
\usepackage{tikz}
\usetikzlibrary{calc}

\begin{document}
  
  \begin{figure}
      \begin{tikzpicture}
      % Draw the line
      \draw (0,0) -- (6,0);
      
      % Draw the number 1 at the beginning
      \draw (0,-0.1) -- (0,0.1) node[above] {1};
      
      % Draw the number 2
      \draw (1,-0.1) -- (1,0.1) node[above] (n2) {2};
      
      % Draw the point N at the right end
      \draw (6,-0.1) -- (6,0.1) node[above] (nN) {N};
      
      % Draw ellipses
      \node at ($(n2)!.5!(nN)$) {$\dots$};
      
      % Draw arrow connecting the diagrams
      \draw[->] (7.25,0) -- (7.75,0);
      
      % Draw a circle to the right of the number line with numbers
      \coordinate (O) at (11,0);
      \draw (11, 0) circle (1.5);
      
      \foreach \x/\xtext in {45/2,90/1,135/N}
      {\draw ($(O)+(\x:1.4)$) --++(\x:.2) node [pos=2] {\xtext};}
      
      \pgfmathsetmacro{\dist}{10}
      \foreach \x in {0,160}
      {
        \node [red] at ($(O)+(\x:1.7)$) {\textbullet};
        \node [red] at ($(O)+(\x+\dist:1.7)$) {\textbullet};
        \node [red] at ($(O)+(\x+2*\dist:1.7)$) {\textbullet};
      }
      
    \end{tikzpicture}
  \end{figure}
\end{document}

enter image description here

0
4

The idea is to use polar corrdinates. You can play with the angles as per your liking. Here is the complete solution:

\documentclass{article}
\usepackage{graphicx} % Required for inserting images
\usepackage{tikz}


\begin{document}

\begin{figure}
    \begin{tikzpicture}
        % Draw the line
        \draw (0,0) -- (6,0);
        
        % Draw the number 1 at the beginning
        \draw (0,-0.1) -- (0,0.1) node[above] {1};
    
        % Draw the number 2
        \draw (1,-0.1) -- (1,0.1) node[above] {2};
    
        % Draw ellipses
        \node at (3,0.1) {$\dots$};
        
        % Draw the point N at the right end
        \draw (6,-0.1) -- (6,0.1) node[above] {N};
    
        % Draw arrow connecting the diagrams
        \draw[->] (7.25,0) -- (7.75,0);
    
        % Draw a circle to the right of the number line with numbers
        \begin{scope}[shift={(11,0)}]
            \def\R{1.5} % radius
            \draw (0, 0) circle (\R);

            
            \node [rotate={60-90}] at (60:\R) {$|$};
            \node [above] at (60:\R+0.2) {2};
            \node at (90:\R) {$|$};
            \node [above] at (90:\R+0.2) {1};
            \node [rotate={120-90}] at (120:\R) {$|$};
            \node [above] at (120:\R+0.2) {N};

            \node [circle,fill=red,inner sep=1pt] at (20:\R+0.2) {~};
            \node [circle,fill=red,inner sep=1pt] at (30:\R+0.2) {~};
            \node [circle,fill=red,inner sep=1pt] at (40:\R+0.2) {~};
            \node [circle,fill=red,inner sep=1pt] at (180-20:\R+0.2) {~};
            \node [circle,fill=red,inner sep=1pt] at (180-30:\R+0.2) {~};
            \node [circle,fill=red,inner sep=1pt] at (180-40:\R+0.2) {~};
        \end{scope}
        
    \end{tikzpicture}
\end{figure}

\end{document}
1
  • 3
    It would be nice if you would post compilable examples so people can reuse them more easily. Commented Jun 11 at 10:34

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .