Putting trace on point in TikZ
Clash 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)?
tikz-pgf animations
add a comment |Â
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)?
tikz-pgf animations
add a comment |Â
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)?
tikz-pgf animations
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)?
tikz-pgf animations
asked Aug 26 at 21:41
current_user
2,419428
2,419428
add a comment |Â
add a comment |Â
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
add a comment |Â
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
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
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
add a comment |Â
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
add a comment |Â
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
add a comment |Â
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
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
edited Aug 26 at 22:59
answered Aug 26 at 22:04
samcarter
74.6k785240
74.6k785240
add a comment |Â
add a comment |Â
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
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
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
add a comment |Â
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
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
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
add a comment |Â
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
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
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
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
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
add a comment |Â
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
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password