Connecting nodes in a proper way

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
2
down vote

favorite












How can I connect the $n$-th node with the $n-1$ node?



documentclass[border=5pt,tikz]standalone
tikzset
io/.style=
fill=black,circle,inner sep=.1pt


begindocument
begintikzpicture
useasboundingbox (-2,-2) rectangle (2,2);
foreach x in 0,10,...,350

% draw[rotate around=(-x:(-x:1))] (0,0) -- (0,1) -- (.5,1) -- (.5,0) arc(0:-180:.25);
node[rotate around=(x:(x:1)),io] ;

endtikzpicture
begintikzpicture
useasboundingbox (-2,-2) rectangle (2,2);
foreach x in 0,1,...,359

node[rotate around=(-x:(4*x:1)),io] ;

endtikzpicture
begintikzpicture
useasboundingbox (-2,-2) rectangle (2,2);
foreach x in 0,1,...,359

pgfmathsetmacroacos(x)*x
node[rotate around=(-x:(a:1)),io] ;

endtikzpicture
begintikzpicture
useasboundingbox (-2,-2) rectangle (2,2);
foreach x in 0,1,...,359

pgfmathsetmacroa12*x
draw[ultra thin] ([rotate around=(-x:(a:1))]0,0) -- (0,0);
node[rotate around=(-x:(a:1)),io] (x) ;

endtikzpicture
begintikzpicture
useasboundingbox (-2,-2) rectangle (2,2);
foreach x in 0,1,...,359

pgfmathsetmacroax^sin(x)
draw[ultra thin] ([rotate around=(-x:(a:1))]0,0) -- (0,0);
node[rotate around=(-x:(a:1)),io] (x) ;

endtikzpicture
begintikzpicture
useasboundingbox (-2,-2) rectangle (2,2);
foreach x in 0,1,...,359

pgfmathsetmacroax^cos(x)
draw[ultra thin] ([rotate around=(-x:(a:1))]0,0) -- (0,0);
node[rotate around=(-x:(a:1)),io] (x) ;

endtikzpicture
begintikzpicture
useasboundingbox (-2,-2) rectangle (2,2);
foreach x in 0,1,...,359

pgfmathsetmacroax^sin(2*x)
draw[ultra thin] ([rotate around=(-x:(a:1))]0,0) -- (0,0);
node[rotate around=(-x:(a:1)),io] (x) ;

endtikzpicture
begintikzpicture
useasboundingbox (-2,-2) rectangle (2,2);
foreach x in 0,1,...,359

pgfmathsetmacroa17*x
draw[ultra thin] ([rotate around=(-x:(a:1))]0,0) -- (0,0);
node[rotate around=(-x:(a:1)),io] (x) ;

endtikzpicture
enddocument


Here is the output:


























share|improve this question

























    up vote
    2
    down vote

    favorite












    How can I connect the $n$-th node with the $n-1$ node?



    documentclass[border=5pt,tikz]standalone
    tikzset
    io/.style=
    fill=black,circle,inner sep=.1pt


    begindocument
    begintikzpicture
    useasboundingbox (-2,-2) rectangle (2,2);
    foreach x in 0,10,...,350

    % draw[rotate around=(-x:(-x:1))] (0,0) -- (0,1) -- (.5,1) -- (.5,0) arc(0:-180:.25);
    node[rotate around=(x:(x:1)),io] ;

    endtikzpicture
    begintikzpicture
    useasboundingbox (-2,-2) rectangle (2,2);
    foreach x in 0,1,...,359

    node[rotate around=(-x:(4*x:1)),io] ;

    endtikzpicture
    begintikzpicture
    useasboundingbox (-2,-2) rectangle (2,2);
    foreach x in 0,1,...,359

    pgfmathsetmacroacos(x)*x
    node[rotate around=(-x:(a:1)),io] ;

    endtikzpicture
    begintikzpicture
    useasboundingbox (-2,-2) rectangle (2,2);
    foreach x in 0,1,...,359

    pgfmathsetmacroa12*x
    draw[ultra thin] ([rotate around=(-x:(a:1))]0,0) -- (0,0);
    node[rotate around=(-x:(a:1)),io] (x) ;

    endtikzpicture
    begintikzpicture
    useasboundingbox (-2,-2) rectangle (2,2);
    foreach x in 0,1,...,359

    pgfmathsetmacroax^sin(x)
    draw[ultra thin] ([rotate around=(-x:(a:1))]0,0) -- (0,0);
    node[rotate around=(-x:(a:1)),io] (x) ;

    endtikzpicture
    begintikzpicture
    useasboundingbox (-2,-2) rectangle (2,2);
    foreach x in 0,1,...,359

    pgfmathsetmacroax^cos(x)
    draw[ultra thin] ([rotate around=(-x:(a:1))]0,0) -- (0,0);
    node[rotate around=(-x:(a:1)),io] (x) ;

    endtikzpicture
    begintikzpicture
    useasboundingbox (-2,-2) rectangle (2,2);
    foreach x in 0,1,...,359

    pgfmathsetmacroax^sin(2*x)
    draw[ultra thin] ([rotate around=(-x:(a:1))]0,0) -- (0,0);
    node[rotate around=(-x:(a:1)),io] (x) ;

    endtikzpicture
    begintikzpicture
    useasboundingbox (-2,-2) rectangle (2,2);
    foreach x in 0,1,...,359

    pgfmathsetmacroa17*x
    draw[ultra thin] ([rotate around=(-x:(a:1))]0,0) -- (0,0);
    node[rotate around=(-x:(a:1)),io] (x) ;

    endtikzpicture
    enddocument


    Here is the output:


























    share|improve this question























      up vote
      2
      down vote

      favorite









      up vote
      2
      down vote

      favorite











      How can I connect the $n$-th node with the $n-1$ node?



      documentclass[border=5pt,tikz]standalone
      tikzset
      io/.style=
      fill=black,circle,inner sep=.1pt


      begindocument
      begintikzpicture
      useasboundingbox (-2,-2) rectangle (2,2);
      foreach x in 0,10,...,350

      % draw[rotate around=(-x:(-x:1))] (0,0) -- (0,1) -- (.5,1) -- (.5,0) arc(0:-180:.25);
      node[rotate around=(x:(x:1)),io] ;

      endtikzpicture
      begintikzpicture
      useasboundingbox (-2,-2) rectangle (2,2);
      foreach x in 0,1,...,359

      node[rotate around=(-x:(4*x:1)),io] ;

      endtikzpicture
      begintikzpicture
      useasboundingbox (-2,-2) rectangle (2,2);
      foreach x in 0,1,...,359

      pgfmathsetmacroacos(x)*x
      node[rotate around=(-x:(a:1)),io] ;

      endtikzpicture
      begintikzpicture
      useasboundingbox (-2,-2) rectangle (2,2);
      foreach x in 0,1,...,359

      pgfmathsetmacroa12*x
      draw[ultra thin] ([rotate around=(-x:(a:1))]0,0) -- (0,0);
      node[rotate around=(-x:(a:1)),io] (x) ;

      endtikzpicture
      begintikzpicture
      useasboundingbox (-2,-2) rectangle (2,2);
      foreach x in 0,1,...,359

      pgfmathsetmacroax^sin(x)
      draw[ultra thin] ([rotate around=(-x:(a:1))]0,0) -- (0,0);
      node[rotate around=(-x:(a:1)),io] (x) ;

      endtikzpicture
      begintikzpicture
      useasboundingbox (-2,-2) rectangle (2,2);
      foreach x in 0,1,...,359

      pgfmathsetmacroax^cos(x)
      draw[ultra thin] ([rotate around=(-x:(a:1))]0,0) -- (0,0);
      node[rotate around=(-x:(a:1)),io] (x) ;

      endtikzpicture
      begintikzpicture
      useasboundingbox (-2,-2) rectangle (2,2);
      foreach x in 0,1,...,359

      pgfmathsetmacroax^sin(2*x)
      draw[ultra thin] ([rotate around=(-x:(a:1))]0,0) -- (0,0);
      node[rotate around=(-x:(a:1)),io] (x) ;

      endtikzpicture
      begintikzpicture
      useasboundingbox (-2,-2) rectangle (2,2);
      foreach x in 0,1,...,359

      pgfmathsetmacroa17*x
      draw[ultra thin] ([rotate around=(-x:(a:1))]0,0) -- (0,0);
      node[rotate around=(-x:(a:1)),io] (x) ;

      endtikzpicture
      enddocument


      Here is the output:


























      share|improve this question













      How can I connect the $n$-th node with the $n-1$ node?



      documentclass[border=5pt,tikz]standalone
      tikzset
      io/.style=
      fill=black,circle,inner sep=.1pt


      begindocument
      begintikzpicture
      useasboundingbox (-2,-2) rectangle (2,2);
      foreach x in 0,10,...,350

      % draw[rotate around=(-x:(-x:1))] (0,0) -- (0,1) -- (.5,1) -- (.5,0) arc(0:-180:.25);
      node[rotate around=(x:(x:1)),io] ;

      endtikzpicture
      begintikzpicture
      useasboundingbox (-2,-2) rectangle (2,2);
      foreach x in 0,1,...,359

      node[rotate around=(-x:(4*x:1)),io] ;

      endtikzpicture
      begintikzpicture
      useasboundingbox (-2,-2) rectangle (2,2);
      foreach x in 0,1,...,359

      pgfmathsetmacroacos(x)*x
      node[rotate around=(-x:(a:1)),io] ;

      endtikzpicture
      begintikzpicture
      useasboundingbox (-2,-2) rectangle (2,2);
      foreach x in 0,1,...,359

      pgfmathsetmacroa12*x
      draw[ultra thin] ([rotate around=(-x:(a:1))]0,0) -- (0,0);
      node[rotate around=(-x:(a:1)),io] (x) ;

      endtikzpicture
      begintikzpicture
      useasboundingbox (-2,-2) rectangle (2,2);
      foreach x in 0,1,...,359

      pgfmathsetmacroax^sin(x)
      draw[ultra thin] ([rotate around=(-x:(a:1))]0,0) -- (0,0);
      node[rotate around=(-x:(a:1)),io] (x) ;

      endtikzpicture
      begintikzpicture
      useasboundingbox (-2,-2) rectangle (2,2);
      foreach x in 0,1,...,359

      pgfmathsetmacroax^cos(x)
      draw[ultra thin] ([rotate around=(-x:(a:1))]0,0) -- (0,0);
      node[rotate around=(-x:(a:1)),io] (x) ;

      endtikzpicture
      begintikzpicture
      useasboundingbox (-2,-2) rectangle (2,2);
      foreach x in 0,1,...,359

      pgfmathsetmacroax^sin(2*x)
      draw[ultra thin] ([rotate around=(-x:(a:1))]0,0) -- (0,0);
      node[rotate around=(-x:(a:1)),io] (x) ;

      endtikzpicture
      begintikzpicture
      useasboundingbox (-2,-2) rectangle (2,2);
      foreach x in 0,1,...,359

      pgfmathsetmacroa17*x
      draw[ultra thin] ([rotate around=(-x:(a:1))]0,0) -- (0,0);
      node[rotate around=(-x:(a:1)),io] (x) ;

      endtikzpicture
      enddocument


      Here is the output:























      tikz-pgf nodes fun






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked 2 hours ago









      current_user

      2,5911428




      2,5911428




















          2 Answers
          2






          active

          oldest

          votes

















          up vote
          3
          down vote













          Here is an answer for your first picture, which works for all your pictures.



          documentclass[border=5pt,tikz]standalone
          tikzset
          io/.style=
          fill=black,circle,inner sep=.1pt


          begindocument
          begintikzpicture
          useasboundingbox (-2,-2) rectangle (2,2);
          foreach x [count=n] in 0,10,...,350

          % draw[rotate around=(-x:(-x:1))] (0,0) -- (0,1) -- (.5,1) -- (.5,0) arc(0:-180:.25);
          node[rotate around=(x:(x:1)),io] (io-n) ;
          ifnumn>1
          pgfmathtruncatemacroprevnn-1
          draw (io-prevn) -- (io-n);
          fi
          xdefnmaxn

          draw (io-nmax) -- (io-1);
          endtikzpicture
          enddocument


          enter image description here



          Here is the full thing.



          documentclass[border=5pt,tikz]standalone
          tikzset
          io/.style=
          fill=black,circle,inner sep=.1pt


          begindocument
          begintikzpicture
          useasboundingbox (-2,-2) rectangle (2,2);
          foreach x [count=n] in 0,10,...,350

          % draw[rotate around=(-x:(-x:1))] (0,0) -- (0,1) -- (.5,1) -- (.5,0) arc(0:-180:.25);
          node[rotate around=(x:(x:1)),io] (io-n) ;
          ifnumn>1
          pgfmathtruncatemacroprevnn-1
          draw (io-prevn) -- (io-n);
          fi
          xdefnmaxn

          draw (io-nmax) -- (io-1);
          endtikzpicture
          begintikzpicture
          useasboundingbox (-2,-2) rectangle (2,2);
          foreach x in 0,1,...,359

          node[rotate around=(-x:(4*x:1)),io] (io-x) ;
          ifnumx>0
          pgfmathtruncatemacroprevxx-1
          draw (io-prevx) -- (io-x);
          fi
          xdefxmaxx

          draw (io-xmax) -- (io-0);
          endtikzpicture
          begintikzpicture
          useasboundingbox (-2,-2) rectangle (2,2);
          foreach x in 0,1,...,359

          pgfmathsetmacroacos(x)*x
          node[rotate around=(-x:(a:1)),io] (io-x) ;
          ifnumx>0
          pgfmathtruncatemacroprevxx-1
          draw (io-prevx) -- (io-x);
          fi
          xdefxmaxx

          draw (io-xmax) -- (io-0);
          endtikzpicture
          begintikzpicture
          useasboundingbox (-2,-2) rectangle (2,2);
          foreach x in 0,1,...,359

          pgfmathsetmacroa12*x
          draw[ultra thin] ([rotate around=(-x:(a:1))]0,0) -- (0,0);
          node[rotate around=(-x:(a:1)),io] (x) ;
          ifnumx>0
          pgfmathtruncatemacroprevxx-1
          draw (prevx) -- (x);
          fi
          xdefxmaxx

          draw (xmax) -- (0);
          endtikzpicture
          begintikzpicture
          useasboundingbox (-2,-2) rectangle (2,2);
          foreach x in 0,1,...,359

          pgfmathsetmacroax^sin(x)
          draw[ultra thin] ([rotate around=(-x:(a:1))]0,0) -- (0,0);
          node[rotate around=(-x:(a:1)),io] (x) ;
          ifnumx>0
          pgfmathtruncatemacroprevxx-1
          draw (prevx) -- (x);
          fi
          xdefxmaxx

          draw (xmax) -- (0);
          endtikzpicture
          begintikzpicture
          useasboundingbox (-2,-2) rectangle (2,2);
          foreach x in 0,1,...,359

          pgfmathsetmacroax^cos(x)
          draw[ultra thin] ([rotate around=(-x:(a:1))]0,0) -- (0,0);
          node[rotate around=(-x:(a:1)),io] (x) ;
          ifnumx>0
          pgfmathtruncatemacroprevxx-1
          draw (prevx) -- (x);
          fi
          xdefxmaxx

          draw (xmax) -- (0);
          endtikzpicture
          begintikzpicture
          useasboundingbox (-2,-2) rectangle (2,2);
          foreach x in 0,1,...,359

          pgfmathsetmacroax^sin(2*x)
          draw[ultra thin] ([rotate around=(-x:(a:1))]0,0) -- (0,0);
          node[rotate around=(-x:(a:1)),io] (x) ;
          ifnumx>0
          pgfmathtruncatemacroprevxx-1
          draw (prevx) -- (x);
          fi
          xdefxmaxx

          draw (xmax) -- (0);
          endtikzpicture
          begintikzpicture
          useasboundingbox (-2,-2) rectangle (2,2);
          foreach x in 0,1,...,359

          pgfmathsetmacroa17*x
          draw[ultra thin] ([rotate around=(-x:(a:1))]0,0) -- (0,0);
          node[rotate around=(-x:(a:1)),io] (x) ;
          ifnumx>0
          pgfmathtruncatemacroprevxx-1
          draw (prevx) -- (x);
          fi
          xdefxmaxx

          draw (xmax) -- (0);
          endtikzpicture
          enddocument


          enter image description here






          share|improve this answer





























            up vote
            2
            down vote













            Very pretty! With much simpler diagrams than yours I label the nodes and remember the labels using code like:



            foreach x [remember=x as X] in 0,10,...,350

            node[rotate around=(x:(x:1)),io](x) ;
            ifnumx>0draw(X)--(x);fi



            The remember=x as X stores the last value of the node label (x) and then I use ifnum to make sure that I am at the second or later label. Using this, your first diagram becomes:



            enter image description here



            If you want to join up the first and last coordinate then it is enough to add:



            draw(350)--(0);


            Here is the full code:



            documentclass[border=5pt,tikz]standalone
            tikzset
            io/.style=
            fill=black,circle,inner sep=.1pt


            begindocument
            begintikzpicture
            useasboundingbox (-2,-2) rectangle (2,2);
            foreach x [remember=x as X] in 0,10,...,350

            % draw[rotate around=(-x:(-x:1))] (0,0) -- (0,1) -- (.5,1) -- (.5,0) arc(0:-180:.25);
            node[rotate around=(x:(x:1)),io](x) ;
            ifnumx>0draw(X)--(x);fi

            endtikzpicture
            begintikzpicture
            useasboundingbox (-2,-2) rectangle (2,2);
            foreach x [remember=x as X] in 0,1,...,359

            node[rotate around=(-x:(4*x:1)),io] (x);
            ifnumx>0draw(X)--(x);fi

            endtikzpicture
            begintikzpicture
            useasboundingbox (-2,-2) rectangle (2,2);
            foreach x [remember=x as X] in 0,1,...,359

            pgfmathsetmacroacos(x)*x
            node[rotate around=(-x:(a:1)),io] (x);
            ifnumx>0draw(X)--(x);fi

            endtikzpicture
            begintikzpicture
            useasboundingbox (-2,-2) rectangle (2,2);
            foreach x [remember=x as X] in 0,1,...,359

            pgfmathsetmacroa12*x
            draw[ultra thin] ([rotate around=(-x:(a:1))]0,0) -- (0,0);
            node[rotate around=(-x:(a:1)),io] (x) ;
            ifnumx>0draw(X)--(x);fi

            endtikzpicture
            begintikzpicture
            useasboundingbox (-2,-2) rectangle (2,2);
            foreach x [remember=x as X] in 0,1,...,359

            pgfmathsetmacroax^sin(x)
            draw[ultra thin] ([rotate around=(-x:(a:1))]0,0) -- (0,0);
            node[rotate around=(-x:(a:1)),io] (x) ;
            ifnumx>0draw(X)--(x);fi

            endtikzpicture
            begintikzpicture
            useasboundingbox (-2,-2) rectangle (2,2);
            foreach x [remember=x as X] in 0,1,...,359

            pgfmathsetmacroax^cos(x)
            draw[ultra thin] ([rotate around=(-x:(a:1))]0,0) -- (0,0);
            node[rotate around=(-x:(a:1)),io] (x) ;
            ifnumx>0draw(X)--(x);fi

            endtikzpicture
            begintikzpicture
            useasboundingbox (-2,-2) rectangle (2,2);
            foreach x [remember=x as X] in 0,1,...,359

            pgfmathsetmacroax^sin(2*x)
            draw[ultra thin] ([rotate around=(-x:(a:1))]0,0) -- (0,0);
            node[rotate around=(-x:(a:1)),io] (x) ;
            ifnumx>0draw(X)--(x);fi

            endtikzpicture
            begintikzpicture
            useasboundingbox (-2,-2) rectangle (2,2);
            foreach x [remember=x as X] in 0,1,...,359

            pgfmathsetmacroa17*x
            draw[ultra thin] ([rotate around=(-x:(a:1))]0,0) -- (0,0);
            node[rotate around=(-x:(a:1)),io] (x) ;
            ifnumx>0draw(X)--(x);fi

            endtikzpicture
            enddocument





            share|improve this answer




















              Your Answer







              StackExchange.ready(function()
              var channelOptions =
              tags: "".split(" "),
              id: "85"
              ;
              initTagRenderer("".split(" "), "".split(" "), channelOptions);

              StackExchange.using("externalEditor", function()
              // Have to fire editor after snippets, if snippets enabled
              if (StackExchange.settings.snippets.snippetsEnabled)
              StackExchange.using("snippets", function()
              createEditor();
              );

              else
              createEditor();

              );

              function createEditor()
              StackExchange.prepareEditor(
              heartbeatType: 'answer',
              convertImagesToLinks: false,
              noModals: false,
              showLowRepImageUploadWarning: true,
              reputationToPostImages: null,
              bindNavPrevention: true,
              postfix: "",
              onDemand: true,
              discardSelector: ".discard-answer"
              ,immediatelyShowMarkdownHelp:true
              );



              );













               

              draft saved


              draft discarded


















              StackExchange.ready(
              function ()
              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f452775%2fconnecting-nodes-in-a-proper-way%23new-answer', 'question_page');

              );

              Post as a guest






























              2 Answers
              2






              active

              oldest

              votes








              2 Answers
              2






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes








              up vote
              3
              down vote













              Here is an answer for your first picture, which works for all your pictures.



              documentclass[border=5pt,tikz]standalone
              tikzset
              io/.style=
              fill=black,circle,inner sep=.1pt


              begindocument
              begintikzpicture
              useasboundingbox (-2,-2) rectangle (2,2);
              foreach x [count=n] in 0,10,...,350

              % draw[rotate around=(-x:(-x:1))] (0,0) -- (0,1) -- (.5,1) -- (.5,0) arc(0:-180:.25);
              node[rotate around=(x:(x:1)),io] (io-n) ;
              ifnumn>1
              pgfmathtruncatemacroprevnn-1
              draw (io-prevn) -- (io-n);
              fi
              xdefnmaxn

              draw (io-nmax) -- (io-1);
              endtikzpicture
              enddocument


              enter image description here



              Here is the full thing.



              documentclass[border=5pt,tikz]standalone
              tikzset
              io/.style=
              fill=black,circle,inner sep=.1pt


              begindocument
              begintikzpicture
              useasboundingbox (-2,-2) rectangle (2,2);
              foreach x [count=n] in 0,10,...,350

              % draw[rotate around=(-x:(-x:1))] (0,0) -- (0,1) -- (.5,1) -- (.5,0) arc(0:-180:.25);
              node[rotate around=(x:(x:1)),io] (io-n) ;
              ifnumn>1
              pgfmathtruncatemacroprevnn-1
              draw (io-prevn) -- (io-n);
              fi
              xdefnmaxn

              draw (io-nmax) -- (io-1);
              endtikzpicture
              begintikzpicture
              useasboundingbox (-2,-2) rectangle (2,2);
              foreach x in 0,1,...,359

              node[rotate around=(-x:(4*x:1)),io] (io-x) ;
              ifnumx>0
              pgfmathtruncatemacroprevxx-1
              draw (io-prevx) -- (io-x);
              fi
              xdefxmaxx

              draw (io-xmax) -- (io-0);
              endtikzpicture
              begintikzpicture
              useasboundingbox (-2,-2) rectangle (2,2);
              foreach x in 0,1,...,359

              pgfmathsetmacroacos(x)*x
              node[rotate around=(-x:(a:1)),io] (io-x) ;
              ifnumx>0
              pgfmathtruncatemacroprevxx-1
              draw (io-prevx) -- (io-x);
              fi
              xdefxmaxx

              draw (io-xmax) -- (io-0);
              endtikzpicture
              begintikzpicture
              useasboundingbox (-2,-2) rectangle (2,2);
              foreach x in 0,1,...,359

              pgfmathsetmacroa12*x
              draw[ultra thin] ([rotate around=(-x:(a:1))]0,0) -- (0,0);
              node[rotate around=(-x:(a:1)),io] (x) ;
              ifnumx>0
              pgfmathtruncatemacroprevxx-1
              draw (prevx) -- (x);
              fi
              xdefxmaxx

              draw (xmax) -- (0);
              endtikzpicture
              begintikzpicture
              useasboundingbox (-2,-2) rectangle (2,2);
              foreach x in 0,1,...,359

              pgfmathsetmacroax^sin(x)
              draw[ultra thin] ([rotate around=(-x:(a:1))]0,0) -- (0,0);
              node[rotate around=(-x:(a:1)),io] (x) ;
              ifnumx>0
              pgfmathtruncatemacroprevxx-1
              draw (prevx) -- (x);
              fi
              xdefxmaxx

              draw (xmax) -- (0);
              endtikzpicture
              begintikzpicture
              useasboundingbox (-2,-2) rectangle (2,2);
              foreach x in 0,1,...,359

              pgfmathsetmacroax^cos(x)
              draw[ultra thin] ([rotate around=(-x:(a:1))]0,0) -- (0,0);
              node[rotate around=(-x:(a:1)),io] (x) ;
              ifnumx>0
              pgfmathtruncatemacroprevxx-1
              draw (prevx) -- (x);
              fi
              xdefxmaxx

              draw (xmax) -- (0);
              endtikzpicture
              begintikzpicture
              useasboundingbox (-2,-2) rectangle (2,2);
              foreach x in 0,1,...,359

              pgfmathsetmacroax^sin(2*x)
              draw[ultra thin] ([rotate around=(-x:(a:1))]0,0) -- (0,0);
              node[rotate around=(-x:(a:1)),io] (x) ;
              ifnumx>0
              pgfmathtruncatemacroprevxx-1
              draw (prevx) -- (x);
              fi
              xdefxmaxx

              draw (xmax) -- (0);
              endtikzpicture
              begintikzpicture
              useasboundingbox (-2,-2) rectangle (2,2);
              foreach x in 0,1,...,359

              pgfmathsetmacroa17*x
              draw[ultra thin] ([rotate around=(-x:(a:1))]0,0) -- (0,0);
              node[rotate around=(-x:(a:1)),io] (x) ;
              ifnumx>0
              pgfmathtruncatemacroprevxx-1
              draw (prevx) -- (x);
              fi
              xdefxmaxx

              draw (xmax) -- (0);
              endtikzpicture
              enddocument


              enter image description here






              share|improve this answer


























                up vote
                3
                down vote













                Here is an answer for your first picture, which works for all your pictures.



                documentclass[border=5pt,tikz]standalone
                tikzset
                io/.style=
                fill=black,circle,inner sep=.1pt


                begindocument
                begintikzpicture
                useasboundingbox (-2,-2) rectangle (2,2);
                foreach x [count=n] in 0,10,...,350

                % draw[rotate around=(-x:(-x:1))] (0,0) -- (0,1) -- (.5,1) -- (.5,0) arc(0:-180:.25);
                node[rotate around=(x:(x:1)),io] (io-n) ;
                ifnumn>1
                pgfmathtruncatemacroprevnn-1
                draw (io-prevn) -- (io-n);
                fi
                xdefnmaxn

                draw (io-nmax) -- (io-1);
                endtikzpicture
                enddocument


                enter image description here



                Here is the full thing.



                documentclass[border=5pt,tikz]standalone
                tikzset
                io/.style=
                fill=black,circle,inner sep=.1pt


                begindocument
                begintikzpicture
                useasboundingbox (-2,-2) rectangle (2,2);
                foreach x [count=n] in 0,10,...,350

                % draw[rotate around=(-x:(-x:1))] (0,0) -- (0,1) -- (.5,1) -- (.5,0) arc(0:-180:.25);
                node[rotate around=(x:(x:1)),io] (io-n) ;
                ifnumn>1
                pgfmathtruncatemacroprevnn-1
                draw (io-prevn) -- (io-n);
                fi
                xdefnmaxn

                draw (io-nmax) -- (io-1);
                endtikzpicture
                begintikzpicture
                useasboundingbox (-2,-2) rectangle (2,2);
                foreach x in 0,1,...,359

                node[rotate around=(-x:(4*x:1)),io] (io-x) ;
                ifnumx>0
                pgfmathtruncatemacroprevxx-1
                draw (io-prevx) -- (io-x);
                fi
                xdefxmaxx

                draw (io-xmax) -- (io-0);
                endtikzpicture
                begintikzpicture
                useasboundingbox (-2,-2) rectangle (2,2);
                foreach x in 0,1,...,359

                pgfmathsetmacroacos(x)*x
                node[rotate around=(-x:(a:1)),io] (io-x) ;
                ifnumx>0
                pgfmathtruncatemacroprevxx-1
                draw (io-prevx) -- (io-x);
                fi
                xdefxmaxx

                draw (io-xmax) -- (io-0);
                endtikzpicture
                begintikzpicture
                useasboundingbox (-2,-2) rectangle (2,2);
                foreach x in 0,1,...,359

                pgfmathsetmacroa12*x
                draw[ultra thin] ([rotate around=(-x:(a:1))]0,0) -- (0,0);
                node[rotate around=(-x:(a:1)),io] (x) ;
                ifnumx>0
                pgfmathtruncatemacroprevxx-1
                draw (prevx) -- (x);
                fi
                xdefxmaxx

                draw (xmax) -- (0);
                endtikzpicture
                begintikzpicture
                useasboundingbox (-2,-2) rectangle (2,2);
                foreach x in 0,1,...,359

                pgfmathsetmacroax^sin(x)
                draw[ultra thin] ([rotate around=(-x:(a:1))]0,0) -- (0,0);
                node[rotate around=(-x:(a:1)),io] (x) ;
                ifnumx>0
                pgfmathtruncatemacroprevxx-1
                draw (prevx) -- (x);
                fi
                xdefxmaxx

                draw (xmax) -- (0);
                endtikzpicture
                begintikzpicture
                useasboundingbox (-2,-2) rectangle (2,2);
                foreach x in 0,1,...,359

                pgfmathsetmacroax^cos(x)
                draw[ultra thin] ([rotate around=(-x:(a:1))]0,0) -- (0,0);
                node[rotate around=(-x:(a:1)),io] (x) ;
                ifnumx>0
                pgfmathtruncatemacroprevxx-1
                draw (prevx) -- (x);
                fi
                xdefxmaxx

                draw (xmax) -- (0);
                endtikzpicture
                begintikzpicture
                useasboundingbox (-2,-2) rectangle (2,2);
                foreach x in 0,1,...,359

                pgfmathsetmacroax^sin(2*x)
                draw[ultra thin] ([rotate around=(-x:(a:1))]0,0) -- (0,0);
                node[rotate around=(-x:(a:1)),io] (x) ;
                ifnumx>0
                pgfmathtruncatemacroprevxx-1
                draw (prevx) -- (x);
                fi
                xdefxmaxx

                draw (xmax) -- (0);
                endtikzpicture
                begintikzpicture
                useasboundingbox (-2,-2) rectangle (2,2);
                foreach x in 0,1,...,359

                pgfmathsetmacroa17*x
                draw[ultra thin] ([rotate around=(-x:(a:1))]0,0) -- (0,0);
                node[rotate around=(-x:(a:1)),io] (x) ;
                ifnumx>0
                pgfmathtruncatemacroprevxx-1
                draw (prevx) -- (x);
                fi
                xdefxmaxx

                draw (xmax) -- (0);
                endtikzpicture
                enddocument


                enter image description here






                share|improve this answer
























                  up vote
                  3
                  down vote










                  up vote
                  3
                  down vote









                  Here is an answer for your first picture, which works for all your pictures.



                  documentclass[border=5pt,tikz]standalone
                  tikzset
                  io/.style=
                  fill=black,circle,inner sep=.1pt


                  begindocument
                  begintikzpicture
                  useasboundingbox (-2,-2) rectangle (2,2);
                  foreach x [count=n] in 0,10,...,350

                  % draw[rotate around=(-x:(-x:1))] (0,0) -- (0,1) -- (.5,1) -- (.5,0) arc(0:-180:.25);
                  node[rotate around=(x:(x:1)),io] (io-n) ;
                  ifnumn>1
                  pgfmathtruncatemacroprevnn-1
                  draw (io-prevn) -- (io-n);
                  fi
                  xdefnmaxn

                  draw (io-nmax) -- (io-1);
                  endtikzpicture
                  enddocument


                  enter image description here



                  Here is the full thing.



                  documentclass[border=5pt,tikz]standalone
                  tikzset
                  io/.style=
                  fill=black,circle,inner sep=.1pt


                  begindocument
                  begintikzpicture
                  useasboundingbox (-2,-2) rectangle (2,2);
                  foreach x [count=n] in 0,10,...,350

                  % draw[rotate around=(-x:(-x:1))] (0,0) -- (0,1) -- (.5,1) -- (.5,0) arc(0:-180:.25);
                  node[rotate around=(x:(x:1)),io] (io-n) ;
                  ifnumn>1
                  pgfmathtruncatemacroprevnn-1
                  draw (io-prevn) -- (io-n);
                  fi
                  xdefnmaxn

                  draw (io-nmax) -- (io-1);
                  endtikzpicture
                  begintikzpicture
                  useasboundingbox (-2,-2) rectangle (2,2);
                  foreach x in 0,1,...,359

                  node[rotate around=(-x:(4*x:1)),io] (io-x) ;
                  ifnumx>0
                  pgfmathtruncatemacroprevxx-1
                  draw (io-prevx) -- (io-x);
                  fi
                  xdefxmaxx

                  draw (io-xmax) -- (io-0);
                  endtikzpicture
                  begintikzpicture
                  useasboundingbox (-2,-2) rectangle (2,2);
                  foreach x in 0,1,...,359

                  pgfmathsetmacroacos(x)*x
                  node[rotate around=(-x:(a:1)),io] (io-x) ;
                  ifnumx>0
                  pgfmathtruncatemacroprevxx-1
                  draw (io-prevx) -- (io-x);
                  fi
                  xdefxmaxx

                  draw (io-xmax) -- (io-0);
                  endtikzpicture
                  begintikzpicture
                  useasboundingbox (-2,-2) rectangle (2,2);
                  foreach x in 0,1,...,359

                  pgfmathsetmacroa12*x
                  draw[ultra thin] ([rotate around=(-x:(a:1))]0,0) -- (0,0);
                  node[rotate around=(-x:(a:1)),io] (x) ;
                  ifnumx>0
                  pgfmathtruncatemacroprevxx-1
                  draw (prevx) -- (x);
                  fi
                  xdefxmaxx

                  draw (xmax) -- (0);
                  endtikzpicture
                  begintikzpicture
                  useasboundingbox (-2,-2) rectangle (2,2);
                  foreach x in 0,1,...,359

                  pgfmathsetmacroax^sin(x)
                  draw[ultra thin] ([rotate around=(-x:(a:1))]0,0) -- (0,0);
                  node[rotate around=(-x:(a:1)),io] (x) ;
                  ifnumx>0
                  pgfmathtruncatemacroprevxx-1
                  draw (prevx) -- (x);
                  fi
                  xdefxmaxx

                  draw (xmax) -- (0);
                  endtikzpicture
                  begintikzpicture
                  useasboundingbox (-2,-2) rectangle (2,2);
                  foreach x in 0,1,...,359

                  pgfmathsetmacroax^cos(x)
                  draw[ultra thin] ([rotate around=(-x:(a:1))]0,0) -- (0,0);
                  node[rotate around=(-x:(a:1)),io] (x) ;
                  ifnumx>0
                  pgfmathtruncatemacroprevxx-1
                  draw (prevx) -- (x);
                  fi
                  xdefxmaxx

                  draw (xmax) -- (0);
                  endtikzpicture
                  begintikzpicture
                  useasboundingbox (-2,-2) rectangle (2,2);
                  foreach x in 0,1,...,359

                  pgfmathsetmacroax^sin(2*x)
                  draw[ultra thin] ([rotate around=(-x:(a:1))]0,0) -- (0,0);
                  node[rotate around=(-x:(a:1)),io] (x) ;
                  ifnumx>0
                  pgfmathtruncatemacroprevxx-1
                  draw (prevx) -- (x);
                  fi
                  xdefxmaxx

                  draw (xmax) -- (0);
                  endtikzpicture
                  begintikzpicture
                  useasboundingbox (-2,-2) rectangle (2,2);
                  foreach x in 0,1,...,359

                  pgfmathsetmacroa17*x
                  draw[ultra thin] ([rotate around=(-x:(a:1))]0,0) -- (0,0);
                  node[rotate around=(-x:(a:1)),io] (x) ;
                  ifnumx>0
                  pgfmathtruncatemacroprevxx-1
                  draw (prevx) -- (x);
                  fi
                  xdefxmaxx

                  draw (xmax) -- (0);
                  endtikzpicture
                  enddocument


                  enter image description here






                  share|improve this answer














                  Here is an answer for your first picture, which works for all your pictures.



                  documentclass[border=5pt,tikz]standalone
                  tikzset
                  io/.style=
                  fill=black,circle,inner sep=.1pt


                  begindocument
                  begintikzpicture
                  useasboundingbox (-2,-2) rectangle (2,2);
                  foreach x [count=n] in 0,10,...,350

                  % draw[rotate around=(-x:(-x:1))] (0,0) -- (0,1) -- (.5,1) -- (.5,0) arc(0:-180:.25);
                  node[rotate around=(x:(x:1)),io] (io-n) ;
                  ifnumn>1
                  pgfmathtruncatemacroprevnn-1
                  draw (io-prevn) -- (io-n);
                  fi
                  xdefnmaxn

                  draw (io-nmax) -- (io-1);
                  endtikzpicture
                  enddocument


                  enter image description here



                  Here is the full thing.



                  documentclass[border=5pt,tikz]standalone
                  tikzset
                  io/.style=
                  fill=black,circle,inner sep=.1pt


                  begindocument
                  begintikzpicture
                  useasboundingbox (-2,-2) rectangle (2,2);
                  foreach x [count=n] in 0,10,...,350

                  % draw[rotate around=(-x:(-x:1))] (0,0) -- (0,1) -- (.5,1) -- (.5,0) arc(0:-180:.25);
                  node[rotate around=(x:(x:1)),io] (io-n) ;
                  ifnumn>1
                  pgfmathtruncatemacroprevnn-1
                  draw (io-prevn) -- (io-n);
                  fi
                  xdefnmaxn

                  draw (io-nmax) -- (io-1);
                  endtikzpicture
                  begintikzpicture
                  useasboundingbox (-2,-2) rectangle (2,2);
                  foreach x in 0,1,...,359

                  node[rotate around=(-x:(4*x:1)),io] (io-x) ;
                  ifnumx>0
                  pgfmathtruncatemacroprevxx-1
                  draw (io-prevx) -- (io-x);
                  fi
                  xdefxmaxx

                  draw (io-xmax) -- (io-0);
                  endtikzpicture
                  begintikzpicture
                  useasboundingbox (-2,-2) rectangle (2,2);
                  foreach x in 0,1,...,359

                  pgfmathsetmacroacos(x)*x
                  node[rotate around=(-x:(a:1)),io] (io-x) ;
                  ifnumx>0
                  pgfmathtruncatemacroprevxx-1
                  draw (io-prevx) -- (io-x);
                  fi
                  xdefxmaxx

                  draw (io-xmax) -- (io-0);
                  endtikzpicture
                  begintikzpicture
                  useasboundingbox (-2,-2) rectangle (2,2);
                  foreach x in 0,1,...,359

                  pgfmathsetmacroa12*x
                  draw[ultra thin] ([rotate around=(-x:(a:1))]0,0) -- (0,0);
                  node[rotate around=(-x:(a:1)),io] (x) ;
                  ifnumx>0
                  pgfmathtruncatemacroprevxx-1
                  draw (prevx) -- (x);
                  fi
                  xdefxmaxx

                  draw (xmax) -- (0);
                  endtikzpicture
                  begintikzpicture
                  useasboundingbox (-2,-2) rectangle (2,2);
                  foreach x in 0,1,...,359

                  pgfmathsetmacroax^sin(x)
                  draw[ultra thin] ([rotate around=(-x:(a:1))]0,0) -- (0,0);
                  node[rotate around=(-x:(a:1)),io] (x) ;
                  ifnumx>0
                  pgfmathtruncatemacroprevxx-1
                  draw (prevx) -- (x);
                  fi
                  xdefxmaxx

                  draw (xmax) -- (0);
                  endtikzpicture
                  begintikzpicture
                  useasboundingbox (-2,-2) rectangle (2,2);
                  foreach x in 0,1,...,359

                  pgfmathsetmacroax^cos(x)
                  draw[ultra thin] ([rotate around=(-x:(a:1))]0,0) -- (0,0);
                  node[rotate around=(-x:(a:1)),io] (x) ;
                  ifnumx>0
                  pgfmathtruncatemacroprevxx-1
                  draw (prevx) -- (x);
                  fi
                  xdefxmaxx

                  draw (xmax) -- (0);
                  endtikzpicture
                  begintikzpicture
                  useasboundingbox (-2,-2) rectangle (2,2);
                  foreach x in 0,1,...,359

                  pgfmathsetmacroax^sin(2*x)
                  draw[ultra thin] ([rotate around=(-x:(a:1))]0,0) -- (0,0);
                  node[rotate around=(-x:(a:1)),io] (x) ;
                  ifnumx>0
                  pgfmathtruncatemacroprevxx-1
                  draw (prevx) -- (x);
                  fi
                  xdefxmaxx

                  draw (xmax) -- (0);
                  endtikzpicture
                  begintikzpicture
                  useasboundingbox (-2,-2) rectangle (2,2);
                  foreach x in 0,1,...,359

                  pgfmathsetmacroa17*x
                  draw[ultra thin] ([rotate around=(-x:(a:1))]0,0) -- (0,0);
                  node[rotate around=(-x:(a:1)),io] (x) ;
                  ifnumx>0
                  pgfmathtruncatemacroprevxx-1
                  draw (prevx) -- (x);
                  fi
                  xdefxmaxx

                  draw (xmax) -- (0);
                  endtikzpicture
                  enddocument


                  enter image description here







                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited 1 hour ago

























                  answered 2 hours ago









                  marmot

                  60.8k464132




                  60.8k464132




















                      up vote
                      2
                      down vote













                      Very pretty! With much simpler diagrams than yours I label the nodes and remember the labels using code like:



                      foreach x [remember=x as X] in 0,10,...,350

                      node[rotate around=(x:(x:1)),io](x) ;
                      ifnumx>0draw(X)--(x);fi



                      The remember=x as X stores the last value of the node label (x) and then I use ifnum to make sure that I am at the second or later label. Using this, your first diagram becomes:



                      enter image description here



                      If you want to join up the first and last coordinate then it is enough to add:



                      draw(350)--(0);


                      Here is the full code:



                      documentclass[border=5pt,tikz]standalone
                      tikzset
                      io/.style=
                      fill=black,circle,inner sep=.1pt


                      begindocument
                      begintikzpicture
                      useasboundingbox (-2,-2) rectangle (2,2);
                      foreach x [remember=x as X] in 0,10,...,350

                      % draw[rotate around=(-x:(-x:1))] (0,0) -- (0,1) -- (.5,1) -- (.5,0) arc(0:-180:.25);
                      node[rotate around=(x:(x:1)),io](x) ;
                      ifnumx>0draw(X)--(x);fi

                      endtikzpicture
                      begintikzpicture
                      useasboundingbox (-2,-2) rectangle (2,2);
                      foreach x [remember=x as X] in 0,1,...,359

                      node[rotate around=(-x:(4*x:1)),io] (x);
                      ifnumx>0draw(X)--(x);fi

                      endtikzpicture
                      begintikzpicture
                      useasboundingbox (-2,-2) rectangle (2,2);
                      foreach x [remember=x as X] in 0,1,...,359

                      pgfmathsetmacroacos(x)*x
                      node[rotate around=(-x:(a:1)),io] (x);
                      ifnumx>0draw(X)--(x);fi

                      endtikzpicture
                      begintikzpicture
                      useasboundingbox (-2,-2) rectangle (2,2);
                      foreach x [remember=x as X] in 0,1,...,359

                      pgfmathsetmacroa12*x
                      draw[ultra thin] ([rotate around=(-x:(a:1))]0,0) -- (0,0);
                      node[rotate around=(-x:(a:1)),io] (x) ;
                      ifnumx>0draw(X)--(x);fi

                      endtikzpicture
                      begintikzpicture
                      useasboundingbox (-2,-2) rectangle (2,2);
                      foreach x [remember=x as X] in 0,1,...,359

                      pgfmathsetmacroax^sin(x)
                      draw[ultra thin] ([rotate around=(-x:(a:1))]0,0) -- (0,0);
                      node[rotate around=(-x:(a:1)),io] (x) ;
                      ifnumx>0draw(X)--(x);fi

                      endtikzpicture
                      begintikzpicture
                      useasboundingbox (-2,-2) rectangle (2,2);
                      foreach x [remember=x as X] in 0,1,...,359

                      pgfmathsetmacroax^cos(x)
                      draw[ultra thin] ([rotate around=(-x:(a:1))]0,0) -- (0,0);
                      node[rotate around=(-x:(a:1)),io] (x) ;
                      ifnumx>0draw(X)--(x);fi

                      endtikzpicture
                      begintikzpicture
                      useasboundingbox (-2,-2) rectangle (2,2);
                      foreach x [remember=x as X] in 0,1,...,359

                      pgfmathsetmacroax^sin(2*x)
                      draw[ultra thin] ([rotate around=(-x:(a:1))]0,0) -- (0,0);
                      node[rotate around=(-x:(a:1)),io] (x) ;
                      ifnumx>0draw(X)--(x);fi

                      endtikzpicture
                      begintikzpicture
                      useasboundingbox (-2,-2) rectangle (2,2);
                      foreach x [remember=x as X] in 0,1,...,359

                      pgfmathsetmacroa17*x
                      draw[ultra thin] ([rotate around=(-x:(a:1))]0,0) -- (0,0);
                      node[rotate around=(-x:(a:1)),io] (x) ;
                      ifnumx>0draw(X)--(x);fi

                      endtikzpicture
                      enddocument





                      share|improve this answer
























                        up vote
                        2
                        down vote













                        Very pretty! With much simpler diagrams than yours I label the nodes and remember the labels using code like:



                        foreach x [remember=x as X] in 0,10,...,350

                        node[rotate around=(x:(x:1)),io](x) ;
                        ifnumx>0draw(X)--(x);fi



                        The remember=x as X stores the last value of the node label (x) and then I use ifnum to make sure that I am at the second or later label. Using this, your first diagram becomes:



                        enter image description here



                        If you want to join up the first and last coordinate then it is enough to add:



                        draw(350)--(0);


                        Here is the full code:



                        documentclass[border=5pt,tikz]standalone
                        tikzset
                        io/.style=
                        fill=black,circle,inner sep=.1pt


                        begindocument
                        begintikzpicture
                        useasboundingbox (-2,-2) rectangle (2,2);
                        foreach x [remember=x as X] in 0,10,...,350

                        % draw[rotate around=(-x:(-x:1))] (0,0) -- (0,1) -- (.5,1) -- (.5,0) arc(0:-180:.25);
                        node[rotate around=(x:(x:1)),io](x) ;
                        ifnumx>0draw(X)--(x);fi

                        endtikzpicture
                        begintikzpicture
                        useasboundingbox (-2,-2) rectangle (2,2);
                        foreach x [remember=x as X] in 0,1,...,359

                        node[rotate around=(-x:(4*x:1)),io] (x);
                        ifnumx>0draw(X)--(x);fi

                        endtikzpicture
                        begintikzpicture
                        useasboundingbox (-2,-2) rectangle (2,2);
                        foreach x [remember=x as X] in 0,1,...,359

                        pgfmathsetmacroacos(x)*x
                        node[rotate around=(-x:(a:1)),io] (x);
                        ifnumx>0draw(X)--(x);fi

                        endtikzpicture
                        begintikzpicture
                        useasboundingbox (-2,-2) rectangle (2,2);
                        foreach x [remember=x as X] in 0,1,...,359

                        pgfmathsetmacroa12*x
                        draw[ultra thin] ([rotate around=(-x:(a:1))]0,0) -- (0,0);
                        node[rotate around=(-x:(a:1)),io] (x) ;
                        ifnumx>0draw(X)--(x);fi

                        endtikzpicture
                        begintikzpicture
                        useasboundingbox (-2,-2) rectangle (2,2);
                        foreach x [remember=x as X] in 0,1,...,359

                        pgfmathsetmacroax^sin(x)
                        draw[ultra thin] ([rotate around=(-x:(a:1))]0,0) -- (0,0);
                        node[rotate around=(-x:(a:1)),io] (x) ;
                        ifnumx>0draw(X)--(x);fi

                        endtikzpicture
                        begintikzpicture
                        useasboundingbox (-2,-2) rectangle (2,2);
                        foreach x [remember=x as X] in 0,1,...,359

                        pgfmathsetmacroax^cos(x)
                        draw[ultra thin] ([rotate around=(-x:(a:1))]0,0) -- (0,0);
                        node[rotate around=(-x:(a:1)),io] (x) ;
                        ifnumx>0draw(X)--(x);fi

                        endtikzpicture
                        begintikzpicture
                        useasboundingbox (-2,-2) rectangle (2,2);
                        foreach x [remember=x as X] in 0,1,...,359

                        pgfmathsetmacroax^sin(2*x)
                        draw[ultra thin] ([rotate around=(-x:(a:1))]0,0) -- (0,0);
                        node[rotate around=(-x:(a:1)),io] (x) ;
                        ifnumx>0draw(X)--(x);fi

                        endtikzpicture
                        begintikzpicture
                        useasboundingbox (-2,-2) rectangle (2,2);
                        foreach x [remember=x as X] in 0,1,...,359

                        pgfmathsetmacroa17*x
                        draw[ultra thin] ([rotate around=(-x:(a:1))]0,0) -- (0,0);
                        node[rotate around=(-x:(a:1)),io] (x) ;
                        ifnumx>0draw(X)--(x);fi

                        endtikzpicture
                        enddocument





                        share|improve this answer






















                          up vote
                          2
                          down vote










                          up vote
                          2
                          down vote









                          Very pretty! With much simpler diagrams than yours I label the nodes and remember the labels using code like:



                          foreach x [remember=x as X] in 0,10,...,350

                          node[rotate around=(x:(x:1)),io](x) ;
                          ifnumx>0draw(X)--(x);fi



                          The remember=x as X stores the last value of the node label (x) and then I use ifnum to make sure that I am at the second or later label. Using this, your first diagram becomes:



                          enter image description here



                          If you want to join up the first and last coordinate then it is enough to add:



                          draw(350)--(0);


                          Here is the full code:



                          documentclass[border=5pt,tikz]standalone
                          tikzset
                          io/.style=
                          fill=black,circle,inner sep=.1pt


                          begindocument
                          begintikzpicture
                          useasboundingbox (-2,-2) rectangle (2,2);
                          foreach x [remember=x as X] in 0,10,...,350

                          % draw[rotate around=(-x:(-x:1))] (0,0) -- (0,1) -- (.5,1) -- (.5,0) arc(0:-180:.25);
                          node[rotate around=(x:(x:1)),io](x) ;
                          ifnumx>0draw(X)--(x);fi

                          endtikzpicture
                          begintikzpicture
                          useasboundingbox (-2,-2) rectangle (2,2);
                          foreach x [remember=x as X] in 0,1,...,359

                          node[rotate around=(-x:(4*x:1)),io] (x);
                          ifnumx>0draw(X)--(x);fi

                          endtikzpicture
                          begintikzpicture
                          useasboundingbox (-2,-2) rectangle (2,2);
                          foreach x [remember=x as X] in 0,1,...,359

                          pgfmathsetmacroacos(x)*x
                          node[rotate around=(-x:(a:1)),io] (x);
                          ifnumx>0draw(X)--(x);fi

                          endtikzpicture
                          begintikzpicture
                          useasboundingbox (-2,-2) rectangle (2,2);
                          foreach x [remember=x as X] in 0,1,...,359

                          pgfmathsetmacroa12*x
                          draw[ultra thin] ([rotate around=(-x:(a:1))]0,0) -- (0,0);
                          node[rotate around=(-x:(a:1)),io] (x) ;
                          ifnumx>0draw(X)--(x);fi

                          endtikzpicture
                          begintikzpicture
                          useasboundingbox (-2,-2) rectangle (2,2);
                          foreach x [remember=x as X] in 0,1,...,359

                          pgfmathsetmacroax^sin(x)
                          draw[ultra thin] ([rotate around=(-x:(a:1))]0,0) -- (0,0);
                          node[rotate around=(-x:(a:1)),io] (x) ;
                          ifnumx>0draw(X)--(x);fi

                          endtikzpicture
                          begintikzpicture
                          useasboundingbox (-2,-2) rectangle (2,2);
                          foreach x [remember=x as X] in 0,1,...,359

                          pgfmathsetmacroax^cos(x)
                          draw[ultra thin] ([rotate around=(-x:(a:1))]0,0) -- (0,0);
                          node[rotate around=(-x:(a:1)),io] (x) ;
                          ifnumx>0draw(X)--(x);fi

                          endtikzpicture
                          begintikzpicture
                          useasboundingbox (-2,-2) rectangle (2,2);
                          foreach x [remember=x as X] in 0,1,...,359

                          pgfmathsetmacroax^sin(2*x)
                          draw[ultra thin] ([rotate around=(-x:(a:1))]0,0) -- (0,0);
                          node[rotate around=(-x:(a:1)),io] (x) ;
                          ifnumx>0draw(X)--(x);fi

                          endtikzpicture
                          begintikzpicture
                          useasboundingbox (-2,-2) rectangle (2,2);
                          foreach x [remember=x as X] in 0,1,...,359

                          pgfmathsetmacroa17*x
                          draw[ultra thin] ([rotate around=(-x:(a:1))]0,0) -- (0,0);
                          node[rotate around=(-x:(a:1)),io] (x) ;
                          ifnumx>0draw(X)--(x);fi

                          endtikzpicture
                          enddocument





                          share|improve this answer












                          Very pretty! With much simpler diagrams than yours I label the nodes and remember the labels using code like:



                          foreach x [remember=x as X] in 0,10,...,350

                          node[rotate around=(x:(x:1)),io](x) ;
                          ifnumx>0draw(X)--(x);fi



                          The remember=x as X stores the last value of the node label (x) and then I use ifnum to make sure that I am at the second or later label. Using this, your first diagram becomes:



                          enter image description here



                          If you want to join up the first and last coordinate then it is enough to add:



                          draw(350)--(0);


                          Here is the full code:



                          documentclass[border=5pt,tikz]standalone
                          tikzset
                          io/.style=
                          fill=black,circle,inner sep=.1pt


                          begindocument
                          begintikzpicture
                          useasboundingbox (-2,-2) rectangle (2,2);
                          foreach x [remember=x as X] in 0,10,...,350

                          % draw[rotate around=(-x:(-x:1))] (0,0) -- (0,1) -- (.5,1) -- (.5,0) arc(0:-180:.25);
                          node[rotate around=(x:(x:1)),io](x) ;
                          ifnumx>0draw(X)--(x);fi

                          endtikzpicture
                          begintikzpicture
                          useasboundingbox (-2,-2) rectangle (2,2);
                          foreach x [remember=x as X] in 0,1,...,359

                          node[rotate around=(-x:(4*x:1)),io] (x);
                          ifnumx>0draw(X)--(x);fi

                          endtikzpicture
                          begintikzpicture
                          useasboundingbox (-2,-2) rectangle (2,2);
                          foreach x [remember=x as X] in 0,1,...,359

                          pgfmathsetmacroacos(x)*x
                          node[rotate around=(-x:(a:1)),io] (x);
                          ifnumx>0draw(X)--(x);fi

                          endtikzpicture
                          begintikzpicture
                          useasboundingbox (-2,-2) rectangle (2,2);
                          foreach x [remember=x as X] in 0,1,...,359

                          pgfmathsetmacroa12*x
                          draw[ultra thin] ([rotate around=(-x:(a:1))]0,0) -- (0,0);
                          node[rotate around=(-x:(a:1)),io] (x) ;
                          ifnumx>0draw(X)--(x);fi

                          endtikzpicture
                          begintikzpicture
                          useasboundingbox (-2,-2) rectangle (2,2);
                          foreach x [remember=x as X] in 0,1,...,359

                          pgfmathsetmacroax^sin(x)
                          draw[ultra thin] ([rotate around=(-x:(a:1))]0,0) -- (0,0);
                          node[rotate around=(-x:(a:1)),io] (x) ;
                          ifnumx>0draw(X)--(x);fi

                          endtikzpicture
                          begintikzpicture
                          useasboundingbox (-2,-2) rectangle (2,2);
                          foreach x [remember=x as X] in 0,1,...,359

                          pgfmathsetmacroax^cos(x)
                          draw[ultra thin] ([rotate around=(-x:(a:1))]0,0) -- (0,0);
                          node[rotate around=(-x:(a:1)),io] (x) ;
                          ifnumx>0draw(X)--(x);fi

                          endtikzpicture
                          begintikzpicture
                          useasboundingbox (-2,-2) rectangle (2,2);
                          foreach x [remember=x as X] in 0,1,...,359

                          pgfmathsetmacroax^sin(2*x)
                          draw[ultra thin] ([rotate around=(-x:(a:1))]0,0) -- (0,0);
                          node[rotate around=(-x:(a:1)),io] (x) ;
                          ifnumx>0draw(X)--(x);fi

                          endtikzpicture
                          begintikzpicture
                          useasboundingbox (-2,-2) rectangle (2,2);
                          foreach x [remember=x as X] in 0,1,...,359

                          pgfmathsetmacroa17*x
                          draw[ultra thin] ([rotate around=(-x:(a:1))]0,0) -- (0,0);
                          node[rotate around=(-x:(a:1)),io] (x) ;
                          ifnumx>0draw(X)--(x);fi

                          endtikzpicture
                          enddocument






                          share|improve this answer












                          share|improve this answer



                          share|improve this answer










                          answered 2 hours ago









                          Andrew

                          27.7k34075




                          27.7k34075



























                               

                              draft saved


                              draft discarded















































                               


                              draft saved


                              draft discarded














                              StackExchange.ready(
                              function ()
                              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f452775%2fconnecting-nodes-in-a-proper-way%23new-answer', 'question_page');

                              );

                              Post as a guest













































































                              Comments

                              Popular posts from this blog

                              Long meetings (6-7 hours a day): Being “babysat” by supervisor

                              Is the Concept of Multiple Fantasy Races Scientifically Flawed? [closed]

                              Confectionery