Putting trace on point in TikZ

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











up vote
6
down vote

favorite












Consider the following MWE:



documentclass[tikz]standalone
begindocument
foreach n in 0,1,2,...,72
begintikzpicture
useasboundingbox (-2.5,-2.5) rectangle (2.5,2.5);
pgfmathsetmacroq10*n
draw[densely dotted] (0,-2.5) -- (0,2.5);
draw (0,0) circle(1);
draw (q:1) -- (0,2.5*sin(q));
fill[black,radius=.1] (q:1) circle;
fill[red,radius=.1] (0,2.5*sin(q)) circle; %use 1*sin(·) …
endtikzpicture

enddocument


My question is: How can I put a trace at the red point (so that a line represents the path of the red point)?







share|improve this question
























    up vote
    6
    down vote

    favorite












    Consider the following MWE:



    documentclass[tikz]standalone
    begindocument
    foreach n in 0,1,2,...,72
    begintikzpicture
    useasboundingbox (-2.5,-2.5) rectangle (2.5,2.5);
    pgfmathsetmacroq10*n
    draw[densely dotted] (0,-2.5) -- (0,2.5);
    draw (0,0) circle(1);
    draw (q:1) -- (0,2.5*sin(q));
    fill[black,radius=.1] (q:1) circle;
    fill[red,radius=.1] (0,2.5*sin(q)) circle; %use 1*sin(·) …
    endtikzpicture

    enddocument


    My question is: How can I put a trace at the red point (so that a line represents the path of the red point)?







    share|improve this question






















      up vote
      6
      down vote

      favorite









      up vote
      6
      down vote

      favorite











      Consider the following MWE:



      documentclass[tikz]standalone
      begindocument
      foreach n in 0,1,2,...,72
      begintikzpicture
      useasboundingbox (-2.5,-2.5) rectangle (2.5,2.5);
      pgfmathsetmacroq10*n
      draw[densely dotted] (0,-2.5) -- (0,2.5);
      draw (0,0) circle(1);
      draw (q:1) -- (0,2.5*sin(q));
      fill[black,radius=.1] (q:1) circle;
      fill[red,radius=.1] (0,2.5*sin(q)) circle; %use 1*sin(·) …
      endtikzpicture

      enddocument


      My question is: How can I put a trace at the red point (so that a line represents the path of the red point)?







      share|improve this question












      Consider the following MWE:



      documentclass[tikz]standalone
      begindocument
      foreach n in 0,1,2,...,72
      begintikzpicture
      useasboundingbox (-2.5,-2.5) rectangle (2.5,2.5);
      pgfmathsetmacroq10*n
      draw[densely dotted] (0,-2.5) -- (0,2.5);
      draw (0,0) circle(1);
      draw (q:1) -- (0,2.5*sin(q));
      fill[black,radius=.1] (q:1) circle;
      fill[red,radius=.1] (0,2.5*sin(q)) circle; %use 1*sin(·) …
      endtikzpicture

      enddocument


      My question is: How can I put a trace at the red point (so that a line represents the path of the red point)?









      share|improve this question











      share|improve this question




      share|improve this question










      asked Aug 26 at 21:41









      current_user

      2,419428




      2,419428




















          2 Answers
          2






          active

          oldest

          votes

















          up vote
          7
          down vote



          accepted










          As far as I can see, you could draw the line by dividing it into three cases:



          documentclass[tikz]standalone
          begindocument
          foreach n in 0,1,2,...,27
          begintikzpicture
          useasboundingbox (-2.5,-2.5) rectangle (2.5,2.5);
          pgfmathsetmacroq10*n
          draw[densely dotted] (0,-2.5) -- (0,2.5);
          draw (0,0) circle(1);
          draw (q:1) -- (0,2.5*sin(q));
          fill[black,radius=.1] (q:1) circle;
          fill[red,radius=.1] (0,2.5*sin(q)) circle; %use 1*sin(·) …
          draw[ultra thick,red] (0,0) -- (0,2.5*sin(q));
          ifnumn>9
          draw[ultra thick,red] (0,0) -- (0,2.5);
          fi
          ifnumn>28
          draw[ultra thick,red] (0,-2.5) -- (0,2.5);
          fi
          endtikzpicture

          enddocument


          enter image description here






          share|improve this answer





























            up vote
            5
            down vote













            THIS IS REALLY JUST FOR FUN. No competitor to @samcarter's nice answer from which most of this is stolen.



            documentclass[tikz]standalone
            usetikzlibrarydecorations.footprints
            begindocument
            tikzsetcat prints/.style=decorate,decoration=footprints,foot length=2pt,stride
            length=5pt,foot sep=1pt,foot of=felis silvestris,red
            foreach n in 0,1,2,...,27
            begintikzpicture
            useasboundingbox (-2.5,-2.5) rectangle (2.5,2.5);
            pgfmathsetmacroq10*n
            draw[densely dotted] (0,-2.5) -- (0,2.5);
            draw (0,0) circle(1);
            draw (q:1) -- (0,2.5*sin(q));
            fill[black,radius=.1] (q:1) circle;
            fill[red,radius=.1] (0,2.5*sin(q)) circle;
            ifnumn<10
            draw[cat prints] (0,0) -- (0,2.5*sin(q));
            else
            ifnumn>9
            draw[cat prints] (0,0) -- (0,2.5);
            draw[cat prints] (0,2.5cm-0.5pt) -- (0,2.5*sin(q));
            fi
            ifnumn>28
            draw[cat prints] (0,0) -- (0,2.5);
            draw[cat prints] (0,2.5cm-0.5pt) -- (0,-2.5cm+0.5pt);
            draw[cat prints] (0,2.5) -- (0,2.5*sin(q));
            fi
            fi
            endtikzpicture

            enddocument


            enter image description here



            UPDATE: Fading footprints. Plus duck queen. ;-)



            documentclass[tikz,border=5mm]standalone
            usetikzlibrarydecorations.footprints,ducks
            newsaveboxDuck
            sboxDucktikzduck[crown,laughing, bill=red,longhair=black]
            newcounterMyFootSteps
            pgfdeclaremetadecorationfading footprintsinitial stateinitial[width=0pt,
            next state=footprint]
            pgfmathparse10-3*int(pgfmetadecoratedpathlength/pgfmetadecorationsegmentlength)
            setcounterMyFootStepspgfmathresult
            pgfsetlinewidth0.2pt
            pgfset/pgf/decoration/foot length=pgfmetadecorationsegmentlength/5,/pgf/decoration/stride
            length=pgfmetadecorationsegmentlength/3,
            /pgf/decoration/foot sep=1pt,/pgf/decoration/foot of=bird

            statefootprint[
            switch if less than=pgfmetadecorationsegmentlength to final,
            width=pgfmetadecorationsegmentlength/3, next state=footprint]
            stepcounterMyFootSteps
            ifnumtheMyFootSteps>0
            pgfsetfillopacity0.1*theMyFootSteps
            decorationfootprints
            pgfusepathqfill
            fi

            statefinalpgfusepathqfill

            begindocument
            tikzsetfading cat prints/.style=decorate,decoration=fading footprints,meta-segment length=15pt
            foreach n in 0,1,2,...,35
            begintikzpicture
            useasboundingbox (-2.5,-2.5) rectangle (2.5,2.5);
            pgfmathsetmacroq10*n
            draw[densely dotted] (0,-2.5) -- (0,2.5);
            draw (0,0) circle(1);
            draw (q:1) -- (0,2.5*sin(q));
            fill[black,radius=.1] (q:1) circle;
            ifnumn<10
            draw[fading cat prints] (0,-2.5) -- (0,2.5*sin(q));
            else
            ifnumn>9
            ifnumn<29
            draw[fading cat prints] (0,0) -- (0,2.5) -- (0,2.5*sin(q));
            else
            draw[fading cat prints] (0,0) -- (0,2.5) -- (0,-2.5) -- (0,2.5*sin(q));
            fi
            fi
            fi
            node[scale=0.5] at (0,2.5*sin(q)) useboxDuck;
            endtikzpicture

            enddocument


            enter image description here






            share|improve this answer


















            • 2




              +1 So great! i.stack.imgur.com/kxtls.gif
              – samcarter
              Aug 26 at 23:42






            • 1




              @samcarter I knew you would do that. Notice that there is also the option "bird" for ducks. ;-)
              – marmot
              Aug 26 at 23:45






            • 1




              @samcarter And I guess you knew you would trigger the update. Now the footprints fade away. ;-) (Of course one could make this more TikZy, i.e. instead of all the hard coded things one could use pgfkeys but I'll leave that for another day.... ;-)
              – marmot
              Aug 27 at 1:02






            • 1




              Fantastic!!!!!!
              – samcarter
              Aug 27 at 8:11










            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%2f447860%2fputting-trace-on-point-in-tikz%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
            7
            down vote



            accepted










            As far as I can see, you could draw the line by dividing it into three cases:



            documentclass[tikz]standalone
            begindocument
            foreach n in 0,1,2,...,27
            begintikzpicture
            useasboundingbox (-2.5,-2.5) rectangle (2.5,2.5);
            pgfmathsetmacroq10*n
            draw[densely dotted] (0,-2.5) -- (0,2.5);
            draw (0,0) circle(1);
            draw (q:1) -- (0,2.5*sin(q));
            fill[black,radius=.1] (q:1) circle;
            fill[red,radius=.1] (0,2.5*sin(q)) circle; %use 1*sin(·) …
            draw[ultra thick,red] (0,0) -- (0,2.5*sin(q));
            ifnumn>9
            draw[ultra thick,red] (0,0) -- (0,2.5);
            fi
            ifnumn>28
            draw[ultra thick,red] (0,-2.5) -- (0,2.5);
            fi
            endtikzpicture

            enddocument


            enter image description here






            share|improve this answer


























              up vote
              7
              down vote



              accepted










              As far as I can see, you could draw the line by dividing it into three cases:



              documentclass[tikz]standalone
              begindocument
              foreach n in 0,1,2,...,27
              begintikzpicture
              useasboundingbox (-2.5,-2.5) rectangle (2.5,2.5);
              pgfmathsetmacroq10*n
              draw[densely dotted] (0,-2.5) -- (0,2.5);
              draw (0,0) circle(1);
              draw (q:1) -- (0,2.5*sin(q));
              fill[black,radius=.1] (q:1) circle;
              fill[red,radius=.1] (0,2.5*sin(q)) circle; %use 1*sin(·) …
              draw[ultra thick,red] (0,0) -- (0,2.5*sin(q));
              ifnumn>9
              draw[ultra thick,red] (0,0) -- (0,2.5);
              fi
              ifnumn>28
              draw[ultra thick,red] (0,-2.5) -- (0,2.5);
              fi
              endtikzpicture

              enddocument


              enter image description here






              share|improve this answer
























                up vote
                7
                down vote



                accepted







                up vote
                7
                down vote



                accepted






                As far as I can see, you could draw the line by dividing it into three cases:



                documentclass[tikz]standalone
                begindocument
                foreach n in 0,1,2,...,27
                begintikzpicture
                useasboundingbox (-2.5,-2.5) rectangle (2.5,2.5);
                pgfmathsetmacroq10*n
                draw[densely dotted] (0,-2.5) -- (0,2.5);
                draw (0,0) circle(1);
                draw (q:1) -- (0,2.5*sin(q));
                fill[black,radius=.1] (q:1) circle;
                fill[red,radius=.1] (0,2.5*sin(q)) circle; %use 1*sin(·) …
                draw[ultra thick,red] (0,0) -- (0,2.5*sin(q));
                ifnumn>9
                draw[ultra thick,red] (0,0) -- (0,2.5);
                fi
                ifnumn>28
                draw[ultra thick,red] (0,-2.5) -- (0,2.5);
                fi
                endtikzpicture

                enddocument


                enter image description here






                share|improve this answer














                As far as I can see, you could draw the line by dividing it into three cases:



                documentclass[tikz]standalone
                begindocument
                foreach n in 0,1,2,...,27
                begintikzpicture
                useasboundingbox (-2.5,-2.5) rectangle (2.5,2.5);
                pgfmathsetmacroq10*n
                draw[densely dotted] (0,-2.5) -- (0,2.5);
                draw (0,0) circle(1);
                draw (q:1) -- (0,2.5*sin(q));
                fill[black,radius=.1] (q:1) circle;
                fill[red,radius=.1] (0,2.5*sin(q)) circle; %use 1*sin(·) …
                draw[ultra thick,red] (0,0) -- (0,2.5*sin(q));
                ifnumn>9
                draw[ultra thick,red] (0,0) -- (0,2.5);
                fi
                ifnumn>28
                draw[ultra thick,red] (0,-2.5) -- (0,2.5);
                fi
                endtikzpicture

                enddocument


                enter image description here







                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited Aug 26 at 22:59

























                answered Aug 26 at 22:04









                samcarter

                74.6k785240




                74.6k785240




















                    up vote
                    5
                    down vote













                    THIS IS REALLY JUST FOR FUN. No competitor to @samcarter's nice answer from which most of this is stolen.



                    documentclass[tikz]standalone
                    usetikzlibrarydecorations.footprints
                    begindocument
                    tikzsetcat prints/.style=decorate,decoration=footprints,foot length=2pt,stride
                    length=5pt,foot sep=1pt,foot of=felis silvestris,red
                    foreach n in 0,1,2,...,27
                    begintikzpicture
                    useasboundingbox (-2.5,-2.5) rectangle (2.5,2.5);
                    pgfmathsetmacroq10*n
                    draw[densely dotted] (0,-2.5) -- (0,2.5);
                    draw (0,0) circle(1);
                    draw (q:1) -- (0,2.5*sin(q));
                    fill[black,radius=.1] (q:1) circle;
                    fill[red,radius=.1] (0,2.5*sin(q)) circle;
                    ifnumn<10
                    draw[cat prints] (0,0) -- (0,2.5*sin(q));
                    else
                    ifnumn>9
                    draw[cat prints] (0,0) -- (0,2.5);
                    draw[cat prints] (0,2.5cm-0.5pt) -- (0,2.5*sin(q));
                    fi
                    ifnumn>28
                    draw[cat prints] (0,0) -- (0,2.5);
                    draw[cat prints] (0,2.5cm-0.5pt) -- (0,-2.5cm+0.5pt);
                    draw[cat prints] (0,2.5) -- (0,2.5*sin(q));
                    fi
                    fi
                    endtikzpicture

                    enddocument


                    enter image description here



                    UPDATE: Fading footprints. Plus duck queen. ;-)



                    documentclass[tikz,border=5mm]standalone
                    usetikzlibrarydecorations.footprints,ducks
                    newsaveboxDuck
                    sboxDucktikzduck[crown,laughing, bill=red,longhair=black]
                    newcounterMyFootSteps
                    pgfdeclaremetadecorationfading footprintsinitial stateinitial[width=0pt,
                    next state=footprint]
                    pgfmathparse10-3*int(pgfmetadecoratedpathlength/pgfmetadecorationsegmentlength)
                    setcounterMyFootStepspgfmathresult
                    pgfsetlinewidth0.2pt
                    pgfset/pgf/decoration/foot length=pgfmetadecorationsegmentlength/5,/pgf/decoration/stride
                    length=pgfmetadecorationsegmentlength/3,
                    /pgf/decoration/foot sep=1pt,/pgf/decoration/foot of=bird

                    statefootprint[
                    switch if less than=pgfmetadecorationsegmentlength to final,
                    width=pgfmetadecorationsegmentlength/3, next state=footprint]
                    stepcounterMyFootSteps
                    ifnumtheMyFootSteps>0
                    pgfsetfillopacity0.1*theMyFootSteps
                    decorationfootprints
                    pgfusepathqfill
                    fi

                    statefinalpgfusepathqfill

                    begindocument
                    tikzsetfading cat prints/.style=decorate,decoration=fading footprints,meta-segment length=15pt
                    foreach n in 0,1,2,...,35
                    begintikzpicture
                    useasboundingbox (-2.5,-2.5) rectangle (2.5,2.5);
                    pgfmathsetmacroq10*n
                    draw[densely dotted] (0,-2.5) -- (0,2.5);
                    draw (0,0) circle(1);
                    draw (q:1) -- (0,2.5*sin(q));
                    fill[black,radius=.1] (q:1) circle;
                    ifnumn<10
                    draw[fading cat prints] (0,-2.5) -- (0,2.5*sin(q));
                    else
                    ifnumn>9
                    ifnumn<29
                    draw[fading cat prints] (0,0) -- (0,2.5) -- (0,2.5*sin(q));
                    else
                    draw[fading cat prints] (0,0) -- (0,2.5) -- (0,-2.5) -- (0,2.5*sin(q));
                    fi
                    fi
                    fi
                    node[scale=0.5] at (0,2.5*sin(q)) useboxDuck;
                    endtikzpicture

                    enddocument


                    enter image description here






                    share|improve this answer


















                    • 2




                      +1 So great! i.stack.imgur.com/kxtls.gif
                      – samcarter
                      Aug 26 at 23:42






                    • 1




                      @samcarter I knew you would do that. Notice that there is also the option "bird" for ducks. ;-)
                      – marmot
                      Aug 26 at 23:45






                    • 1




                      @samcarter And I guess you knew you would trigger the update. Now the footprints fade away. ;-) (Of course one could make this more TikZy, i.e. instead of all the hard coded things one could use pgfkeys but I'll leave that for another day.... ;-)
                      – marmot
                      Aug 27 at 1:02






                    • 1




                      Fantastic!!!!!!
                      – samcarter
                      Aug 27 at 8:11














                    up vote
                    5
                    down vote













                    THIS IS REALLY JUST FOR FUN. No competitor to @samcarter's nice answer from which most of this is stolen.



                    documentclass[tikz]standalone
                    usetikzlibrarydecorations.footprints
                    begindocument
                    tikzsetcat prints/.style=decorate,decoration=footprints,foot length=2pt,stride
                    length=5pt,foot sep=1pt,foot of=felis silvestris,red
                    foreach n in 0,1,2,...,27
                    begintikzpicture
                    useasboundingbox (-2.5,-2.5) rectangle (2.5,2.5);
                    pgfmathsetmacroq10*n
                    draw[densely dotted] (0,-2.5) -- (0,2.5);
                    draw (0,0) circle(1);
                    draw (q:1) -- (0,2.5*sin(q));
                    fill[black,radius=.1] (q:1) circle;
                    fill[red,radius=.1] (0,2.5*sin(q)) circle;
                    ifnumn<10
                    draw[cat prints] (0,0) -- (0,2.5*sin(q));
                    else
                    ifnumn>9
                    draw[cat prints] (0,0) -- (0,2.5);
                    draw[cat prints] (0,2.5cm-0.5pt) -- (0,2.5*sin(q));
                    fi
                    ifnumn>28
                    draw[cat prints] (0,0) -- (0,2.5);
                    draw[cat prints] (0,2.5cm-0.5pt) -- (0,-2.5cm+0.5pt);
                    draw[cat prints] (0,2.5) -- (0,2.5*sin(q));
                    fi
                    fi
                    endtikzpicture

                    enddocument


                    enter image description here



                    UPDATE: Fading footprints. Plus duck queen. ;-)



                    documentclass[tikz,border=5mm]standalone
                    usetikzlibrarydecorations.footprints,ducks
                    newsaveboxDuck
                    sboxDucktikzduck[crown,laughing, bill=red,longhair=black]
                    newcounterMyFootSteps
                    pgfdeclaremetadecorationfading footprintsinitial stateinitial[width=0pt,
                    next state=footprint]
                    pgfmathparse10-3*int(pgfmetadecoratedpathlength/pgfmetadecorationsegmentlength)
                    setcounterMyFootStepspgfmathresult
                    pgfsetlinewidth0.2pt
                    pgfset/pgf/decoration/foot length=pgfmetadecorationsegmentlength/5,/pgf/decoration/stride
                    length=pgfmetadecorationsegmentlength/3,
                    /pgf/decoration/foot sep=1pt,/pgf/decoration/foot of=bird

                    statefootprint[
                    switch if less than=pgfmetadecorationsegmentlength to final,
                    width=pgfmetadecorationsegmentlength/3, next state=footprint]
                    stepcounterMyFootSteps
                    ifnumtheMyFootSteps>0
                    pgfsetfillopacity0.1*theMyFootSteps
                    decorationfootprints
                    pgfusepathqfill
                    fi

                    statefinalpgfusepathqfill

                    begindocument
                    tikzsetfading cat prints/.style=decorate,decoration=fading footprints,meta-segment length=15pt
                    foreach n in 0,1,2,...,35
                    begintikzpicture
                    useasboundingbox (-2.5,-2.5) rectangle (2.5,2.5);
                    pgfmathsetmacroq10*n
                    draw[densely dotted] (0,-2.5) -- (0,2.5);
                    draw (0,0) circle(1);
                    draw (q:1) -- (0,2.5*sin(q));
                    fill[black,radius=.1] (q:1) circle;
                    ifnumn<10
                    draw[fading cat prints] (0,-2.5) -- (0,2.5*sin(q));
                    else
                    ifnumn>9
                    ifnumn<29
                    draw[fading cat prints] (0,0) -- (0,2.5) -- (0,2.5*sin(q));
                    else
                    draw[fading cat prints] (0,0) -- (0,2.5) -- (0,-2.5) -- (0,2.5*sin(q));
                    fi
                    fi
                    fi
                    node[scale=0.5] at (0,2.5*sin(q)) useboxDuck;
                    endtikzpicture

                    enddocument


                    enter image description here






                    share|improve this answer


















                    • 2




                      +1 So great! i.stack.imgur.com/kxtls.gif
                      – samcarter
                      Aug 26 at 23:42






                    • 1




                      @samcarter I knew you would do that. Notice that there is also the option "bird" for ducks. ;-)
                      – marmot
                      Aug 26 at 23:45






                    • 1




                      @samcarter And I guess you knew you would trigger the update. Now the footprints fade away. ;-) (Of course one could make this more TikZy, i.e. instead of all the hard coded things one could use pgfkeys but I'll leave that for another day.... ;-)
                      – marmot
                      Aug 27 at 1:02






                    • 1




                      Fantastic!!!!!!
                      – samcarter
                      Aug 27 at 8:11












                    up vote
                    5
                    down vote










                    up vote
                    5
                    down vote









                    THIS IS REALLY JUST FOR FUN. No competitor to @samcarter's nice answer from which most of this is stolen.



                    documentclass[tikz]standalone
                    usetikzlibrarydecorations.footprints
                    begindocument
                    tikzsetcat prints/.style=decorate,decoration=footprints,foot length=2pt,stride
                    length=5pt,foot sep=1pt,foot of=felis silvestris,red
                    foreach n in 0,1,2,...,27
                    begintikzpicture
                    useasboundingbox (-2.5,-2.5) rectangle (2.5,2.5);
                    pgfmathsetmacroq10*n
                    draw[densely dotted] (0,-2.5) -- (0,2.5);
                    draw (0,0) circle(1);
                    draw (q:1) -- (0,2.5*sin(q));
                    fill[black,radius=.1] (q:1) circle;
                    fill[red,radius=.1] (0,2.5*sin(q)) circle;
                    ifnumn<10
                    draw[cat prints] (0,0) -- (0,2.5*sin(q));
                    else
                    ifnumn>9
                    draw[cat prints] (0,0) -- (0,2.5);
                    draw[cat prints] (0,2.5cm-0.5pt) -- (0,2.5*sin(q));
                    fi
                    ifnumn>28
                    draw[cat prints] (0,0) -- (0,2.5);
                    draw[cat prints] (0,2.5cm-0.5pt) -- (0,-2.5cm+0.5pt);
                    draw[cat prints] (0,2.5) -- (0,2.5*sin(q));
                    fi
                    fi
                    endtikzpicture

                    enddocument


                    enter image description here



                    UPDATE: Fading footprints. Plus duck queen. ;-)



                    documentclass[tikz,border=5mm]standalone
                    usetikzlibrarydecorations.footprints,ducks
                    newsaveboxDuck
                    sboxDucktikzduck[crown,laughing, bill=red,longhair=black]
                    newcounterMyFootSteps
                    pgfdeclaremetadecorationfading footprintsinitial stateinitial[width=0pt,
                    next state=footprint]
                    pgfmathparse10-3*int(pgfmetadecoratedpathlength/pgfmetadecorationsegmentlength)
                    setcounterMyFootStepspgfmathresult
                    pgfsetlinewidth0.2pt
                    pgfset/pgf/decoration/foot length=pgfmetadecorationsegmentlength/5,/pgf/decoration/stride
                    length=pgfmetadecorationsegmentlength/3,
                    /pgf/decoration/foot sep=1pt,/pgf/decoration/foot of=bird

                    statefootprint[
                    switch if less than=pgfmetadecorationsegmentlength to final,
                    width=pgfmetadecorationsegmentlength/3, next state=footprint]
                    stepcounterMyFootSteps
                    ifnumtheMyFootSteps>0
                    pgfsetfillopacity0.1*theMyFootSteps
                    decorationfootprints
                    pgfusepathqfill
                    fi

                    statefinalpgfusepathqfill

                    begindocument
                    tikzsetfading cat prints/.style=decorate,decoration=fading footprints,meta-segment length=15pt
                    foreach n in 0,1,2,...,35
                    begintikzpicture
                    useasboundingbox (-2.5,-2.5) rectangle (2.5,2.5);
                    pgfmathsetmacroq10*n
                    draw[densely dotted] (0,-2.5) -- (0,2.5);
                    draw (0,0) circle(1);
                    draw (q:1) -- (0,2.5*sin(q));
                    fill[black,radius=.1] (q:1) circle;
                    ifnumn<10
                    draw[fading cat prints] (0,-2.5) -- (0,2.5*sin(q));
                    else
                    ifnumn>9
                    ifnumn<29
                    draw[fading cat prints] (0,0) -- (0,2.5) -- (0,2.5*sin(q));
                    else
                    draw[fading cat prints] (0,0) -- (0,2.5) -- (0,-2.5) -- (0,2.5*sin(q));
                    fi
                    fi
                    fi
                    node[scale=0.5] at (0,2.5*sin(q)) useboxDuck;
                    endtikzpicture

                    enddocument


                    enter image description here






                    share|improve this answer














                    THIS IS REALLY JUST FOR FUN. No competitor to @samcarter's nice answer from which most of this is stolen.



                    documentclass[tikz]standalone
                    usetikzlibrarydecorations.footprints
                    begindocument
                    tikzsetcat prints/.style=decorate,decoration=footprints,foot length=2pt,stride
                    length=5pt,foot sep=1pt,foot of=felis silvestris,red
                    foreach n in 0,1,2,...,27
                    begintikzpicture
                    useasboundingbox (-2.5,-2.5) rectangle (2.5,2.5);
                    pgfmathsetmacroq10*n
                    draw[densely dotted] (0,-2.5) -- (0,2.5);
                    draw (0,0) circle(1);
                    draw (q:1) -- (0,2.5*sin(q));
                    fill[black,radius=.1] (q:1) circle;
                    fill[red,radius=.1] (0,2.5*sin(q)) circle;
                    ifnumn<10
                    draw[cat prints] (0,0) -- (0,2.5*sin(q));
                    else
                    ifnumn>9
                    draw[cat prints] (0,0) -- (0,2.5);
                    draw[cat prints] (0,2.5cm-0.5pt) -- (0,2.5*sin(q));
                    fi
                    ifnumn>28
                    draw[cat prints] (0,0) -- (0,2.5);
                    draw[cat prints] (0,2.5cm-0.5pt) -- (0,-2.5cm+0.5pt);
                    draw[cat prints] (0,2.5) -- (0,2.5*sin(q));
                    fi
                    fi
                    endtikzpicture

                    enddocument


                    enter image description here



                    UPDATE: Fading footprints. Plus duck queen. ;-)



                    documentclass[tikz,border=5mm]standalone
                    usetikzlibrarydecorations.footprints,ducks
                    newsaveboxDuck
                    sboxDucktikzduck[crown,laughing, bill=red,longhair=black]
                    newcounterMyFootSteps
                    pgfdeclaremetadecorationfading footprintsinitial stateinitial[width=0pt,
                    next state=footprint]
                    pgfmathparse10-3*int(pgfmetadecoratedpathlength/pgfmetadecorationsegmentlength)
                    setcounterMyFootStepspgfmathresult
                    pgfsetlinewidth0.2pt
                    pgfset/pgf/decoration/foot length=pgfmetadecorationsegmentlength/5,/pgf/decoration/stride
                    length=pgfmetadecorationsegmentlength/3,
                    /pgf/decoration/foot sep=1pt,/pgf/decoration/foot of=bird

                    statefootprint[
                    switch if less than=pgfmetadecorationsegmentlength to final,
                    width=pgfmetadecorationsegmentlength/3, next state=footprint]
                    stepcounterMyFootSteps
                    ifnumtheMyFootSteps>0
                    pgfsetfillopacity0.1*theMyFootSteps
                    decorationfootprints
                    pgfusepathqfill
                    fi

                    statefinalpgfusepathqfill

                    begindocument
                    tikzsetfading cat prints/.style=decorate,decoration=fading footprints,meta-segment length=15pt
                    foreach n in 0,1,2,...,35
                    begintikzpicture
                    useasboundingbox (-2.5,-2.5) rectangle (2.5,2.5);
                    pgfmathsetmacroq10*n
                    draw[densely dotted] (0,-2.5) -- (0,2.5);
                    draw (0,0) circle(1);
                    draw (q:1) -- (0,2.5*sin(q));
                    fill[black,radius=.1] (q:1) circle;
                    ifnumn<10
                    draw[fading cat prints] (0,-2.5) -- (0,2.5*sin(q));
                    else
                    ifnumn>9
                    ifnumn<29
                    draw[fading cat prints] (0,0) -- (0,2.5) -- (0,2.5*sin(q));
                    else
                    draw[fading cat prints] (0,0) -- (0,2.5) -- (0,-2.5) -- (0,2.5*sin(q));
                    fi
                    fi
                    fi
                    node[scale=0.5] at (0,2.5*sin(q)) useboxDuck;
                    endtikzpicture

                    enddocument


                    enter image description here







                    share|improve this answer














                    share|improve this answer



                    share|improve this answer








                    edited Aug 27 at 1:06

























                    answered Aug 26 at 23:20









                    marmot

                    55.7k461121




                    55.7k461121







                    • 2




                      +1 So great! i.stack.imgur.com/kxtls.gif
                      – samcarter
                      Aug 26 at 23:42






                    • 1




                      @samcarter I knew you would do that. Notice that there is also the option "bird" for ducks. ;-)
                      – marmot
                      Aug 26 at 23:45






                    • 1




                      @samcarter And I guess you knew you would trigger the update. Now the footprints fade away. ;-) (Of course one could make this more TikZy, i.e. instead of all the hard coded things one could use pgfkeys but I'll leave that for another day.... ;-)
                      – marmot
                      Aug 27 at 1:02






                    • 1




                      Fantastic!!!!!!
                      – samcarter
                      Aug 27 at 8:11












                    • 2




                      +1 So great! i.stack.imgur.com/kxtls.gif
                      – samcarter
                      Aug 26 at 23:42






                    • 1




                      @samcarter I knew you would do that. Notice that there is also the option "bird" for ducks. ;-)
                      – marmot
                      Aug 26 at 23:45






                    • 1




                      @samcarter And I guess you knew you would trigger the update. Now the footprints fade away. ;-) (Of course one could make this more TikZy, i.e. instead of all the hard coded things one could use pgfkeys but I'll leave that for another day.... ;-)
                      – marmot
                      Aug 27 at 1:02






                    • 1




                      Fantastic!!!!!!
                      – samcarter
                      Aug 27 at 8:11







                    2




                    2




                    +1 So great! i.stack.imgur.com/kxtls.gif
                    – samcarter
                    Aug 26 at 23:42




                    +1 So great! i.stack.imgur.com/kxtls.gif
                    – samcarter
                    Aug 26 at 23:42




                    1




                    1




                    @samcarter I knew you would do that. Notice that there is also the option "bird" for ducks. ;-)
                    – marmot
                    Aug 26 at 23:45




                    @samcarter I knew you would do that. Notice that there is also the option "bird" for ducks. ;-)
                    – marmot
                    Aug 26 at 23:45




                    1




                    1




                    @samcarter And I guess you knew you would trigger the update. Now the footprints fade away. ;-) (Of course one could make this more TikZy, i.e. instead of all the hard coded things one could use pgfkeys but I'll leave that for another day.... ;-)
                    – marmot
                    Aug 27 at 1:02




                    @samcarter And I guess you knew you would trigger the update. Now the footprints fade away. ;-) (Of course one could make this more TikZy, i.e. instead of all the hard coded things one could use pgfkeys but I'll leave that for another day.... ;-)
                    – marmot
                    Aug 27 at 1:02




                    1




                    1




                    Fantastic!!!!!!
                    – samcarter
                    Aug 27 at 8:11




                    Fantastic!!!!!!
                    – samcarter
                    Aug 27 at 8:11

















                     

                    draft saved


                    draft discarded















































                     


                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f447860%2fputting-trace-on-point-in-tikz%23new-answer', 'question_page');

                    );

                    Post as a guest













































































                    這個網誌中的熱門文章

                    How to combine Bézier curves to a surface?

                    Why am i infinitely getting the same tweet with the Twitter Search API?

                    Carbon dioxide