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


using this code


    % 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};

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


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

 \foreach \X in {0,...,15}
   \begin{scope}[canvas is yz plane at x=0] %,transform shape
    mark=between positions 0 and 1 step 0.05 with {%
    info/sequence number}}
      \fill[green] (0,0) coordinate(p\X-\itest) circle[radius=2pt];
      \fill[gray] (0,0) coordinate(p\X-\itest) circle[radius=2pt];
    \fi}}},rotate=18] (\R,0) node{$x^{\X}$} circle[radius=\r];
  \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); 

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.