1

I need to create this tikzpicture enter image description here It was taken from A Homomorphic Encryption Illustrated Primer. All I have managed to create so far was this

arc

using this code

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{arrows.meta,arrows}

\begin{document}
\begin{tikzpicture}
    % Create equidistant points and arc
    \foreach \x [count=\p] in {0,...,11} {
        \node[shape=circle,fill=black, scale=0.5] (\p) at (-\x*30:2) {};
    };

    % Create labes with numbers starting from 0
    \foreach \x [count=\p] in {0,...,11} {
        \draw (-\x*30:2.4) node {\x};
    };

    % Draw the arrow
    \draw[->,>=stealth',thick, blue!60!black] (212:2) arc[radius=2, start angle = 212, end angle = 90];
    \node at (0,0){TEXT};
    \end{tikzpicture}
\end{document}

I've searched in the direction of creating a torus but I'm still nowhere close to my Need.

2

This does something of that sort. If you add more explanation, it might be possible to improve it.

\documentclass[border=3.14mm,tikz]{standalone}
\usepackage{tikz-3dplot} 
\usetikzlibrary{3d,decorations.markings}
\begin{document}
\tdplotsetmaincoords{60}{2}
\begin{tikzpicture}[tdplot_main_coords]
\def\r{2}
\def\R{5}
 \foreach \X in {0,...,15}
 {\tdplotsetrotatedcoords{-\X*360/16}{0}{0}
  \begin{scope}[tdplot_rotated_coords] 
   \begin{scope}[canvas is yz plane at x=0] %,transform shape
    \draw[postaction={decorate,decoration={markings,
    mark=between positions 0 and 1 step 0.05 with {%
    \pgfmathtruncatemacro{\itest}{\pgfkeysvalueof{/pgf/decoration/mark
    info/sequence number}}
    \ifnum\itest=20
      \fill[green] (0,0) coordinate(p\X-\itest) circle[radius=2pt];
    \else
      \fill[gray] (0,0) coordinate(p\X-\itest) circle[radius=2pt];
    \fi}}},rotate=18] (\R,0) node{$x^{\X}$} circle[radius=\r];
   \end{scope}
  \end{scope}}
  \fill[red] (p14-2) circle[radius=2pt];
  \draw[red,thick,-latex] plot[smooth,variable=\x,samples at={14,15,0,1,2}] (p\x-2); 
  \fill[red] (p2-2) circle[radius=2pt];
  \draw[red,thick,-latex] plot[smooth,variable=\x,samples at={2,1,20,19}] (p2-\x); 
\end{tikzpicture}
\end{document} 

enter image description here

EDIT: Made the green circle in the foreground visible, as suggested by KJO.

  • But :-) it does not have the same errors as the original :-) and there is one green dot missing :-( – user170109 Mar 23 at 15:22
  • @KJO Well, I can't do much about the errors but the green dot is not missing but hidden behind a gray one. – marmot Mar 23 at 15:31
  • third dot up at the bottom should be visibly green in foreground hiding the grey one – user170109 Mar 23 at 15:43
  • 1
    @marmot thank you very much it is very close to what I need. I'll be playing with your example to get what I need. – TalG Mar 23 at 16:46
  • @marmot is there a way to change the number of points in the smaller circles? – TalG Mar 23 at 22:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.