Pacman circle in TikZ The 2019 Stack Overflow Developer Survey Results Are In Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)How to draw a fish?How to make a simple drawing of an apple using only the tikz library?Exporting animation created with animate packageExtract x, y coordinate of an arbitrary point on curve in TikZTikZ: Cropping the Bounding Boxhighlighting some areas in a picture by making the rest of the picture transparentReuse of soft path in fading declaration? Transformation of fadings?TikZ circle sizetikz draw circle segmentTable-like lines in tikz matrixExclude from fill. It works, but WHY?Define a new rectangular node with several anchor points in tikzHow can I define a key that adds a coloured border inside a closed path, but plays nice with fill?coloring left region of a path in a string diagram

Why are PDP-7-style microprogrammed instructions out of vogue?

Windows 10: How to Lock (not sleep) laptop on lid close?

How to read αἱμύλιος or when to aspirate

"is" operation returns false even though two objects have same id

Button changing its text & action. Good or terrible?

My body leaves; my core can stay

How to support a colleague who finds meetings extremely tiring?

Why can't devices on different VLANs, but on the same subnet, communicate?

What is the role of 'For' here?

60's-70's movie: home appliances revolting against the owners

Didn't get enough time to take a Coding Test - what to do now?

Sort list of array linked objects by keys and values

Is 'stolen' appropriate word?

Could an empire control the whole planet with today's comunication methods?

Do I have Disadvantage attacking with an off-hand weapon?

How to determine omitted units in a publication

Simulating Exploding Dice

Is there a way to generate uniformly distributed points on a sphere from a fixed amount of random real numbers per point?

Why did Peik Lin say, "I'm not an animal"?

Why don't hard Brexiteers insist on a hard border to prevent illegal immigration after Brexit?

Why doesn't a hydraulic lever violate conservation of energy?

Is every episode of "Where are my Pants?" identical?

Why are there uneven bright areas in this photo of black hole?

ELI5: Why do they say that Israel would have been the fourth country to land a spacecraft on the Moon and why do they call it low cost?



Pacman circle in TikZ



The 2019 Stack Overflow Developer Survey Results Are In
Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)How to draw a fish?How to make a simple drawing of an apple using only the tikz library?Exporting animation created with animate packageExtract x, y coordinate of an arbitrary point on curve in TikZTikZ: Cropping the Bounding Boxhighlighting some areas in a picture by making the rest of the picture transparentReuse of soft path in fading declaration? Transformation of fadings?TikZ circle sizetikz draw circle segmentTable-like lines in tikz matrixExclude from fill. It works, but WHY?Define a new rectangular node with several anchor points in tikzHow can I define a key that adds a coloured border inside a closed path, but plays nice with fill?coloring left region of a path in a string diagram










21















I want to draw the Pacman circle on TikZ:



http://www.vectorstash.com/content/pac-man



Drawing a circle and filling in a color is easy; it's the mouth part that's troubling me. I can draw the two straight lines, but then I try to connect them with a curve using the [out=...,in=...] syntax and I can't get it to work. Is there an easier way to make this work?



What I've tried:



begintikzpicture
path[fill=yellow] (2,1.1) to [out=30,in=150] (0,1.2) to [out=30,in=150] (2,1.3) -- (1,1.2) -- (2,1.1);
endtikzpicture









share|improve this question
























  • Welcome to TeX.SE! The picture you are referring to has straight lines. So how precisely should the Pacman look like? Could you show what you have tried?

    – marmot
    Apr 28 '18 at 3:44












  • Certainly! I've tried the code above. I just can't get the curve right.

    – user11550
    Apr 28 '18 at 3:48















21















I want to draw the Pacman circle on TikZ:



http://www.vectorstash.com/content/pac-man



Drawing a circle and filling in a color is easy; it's the mouth part that's troubling me. I can draw the two straight lines, but then I try to connect them with a curve using the [out=...,in=...] syntax and I can't get it to work. Is there an easier way to make this work?



What I've tried:



begintikzpicture
path[fill=yellow] (2,1.1) to [out=30,in=150] (0,1.2) to [out=30,in=150] (2,1.3) -- (1,1.2) -- (2,1.1);
endtikzpicture









share|improve this question
























  • Welcome to TeX.SE! The picture you are referring to has straight lines. So how precisely should the Pacman look like? Could you show what you have tried?

    – marmot
    Apr 28 '18 at 3:44












  • Certainly! I've tried the code above. I just can't get the curve right.

    – user11550
    Apr 28 '18 at 3:48













21












21








21


6






I want to draw the Pacman circle on TikZ:



http://www.vectorstash.com/content/pac-man



Drawing a circle and filling in a color is easy; it's the mouth part that's troubling me. I can draw the two straight lines, but then I try to connect them with a curve using the [out=...,in=...] syntax and I can't get it to work. Is there an easier way to make this work?



What I've tried:



begintikzpicture
path[fill=yellow] (2,1.1) to [out=30,in=150] (0,1.2) to [out=30,in=150] (2,1.3) -- (1,1.2) -- (2,1.1);
endtikzpicture









share|improve this question
















I want to draw the Pacman circle on TikZ:



http://www.vectorstash.com/content/pac-man



Drawing a circle and filling in a color is easy; it's the mouth part that's troubling me. I can draw the two straight lines, but then I try to connect them with a curve using the [out=...,in=...] syntax and I can't get it to work. Is there an easier way to make this work?



What I've tried:



begintikzpicture
path[fill=yellow] (2,1.1) to [out=30,in=150] (0,1.2) to [out=30,in=150] (2,1.3) -- (1,1.2) -- (2,1.1);
endtikzpicture






tikz-pgf






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Apr 28 '18 at 3:48







user11550

















asked Apr 28 '18 at 3:38









user11550user11550

2085




2085












  • Welcome to TeX.SE! The picture you are referring to has straight lines. So how precisely should the Pacman look like? Could you show what you have tried?

    – marmot
    Apr 28 '18 at 3:44












  • Certainly! I've tried the code above. I just can't get the curve right.

    – user11550
    Apr 28 '18 at 3:48

















  • Welcome to TeX.SE! The picture you are referring to has straight lines. So how precisely should the Pacman look like? Could you show what you have tried?

    – marmot
    Apr 28 '18 at 3:44












  • Certainly! I've tried the code above. I just can't get the curve right.

    – user11550
    Apr 28 '18 at 3:48
















Welcome to TeX.SE! The picture you are referring to has straight lines. So how precisely should the Pacman look like? Could you show what you have tried?

– marmot
Apr 28 '18 at 3:44






Welcome to TeX.SE! The picture you are referring to has straight lines. So how precisely should the Pacman look like? Could you show what you have tried?

– marmot
Apr 28 '18 at 3:44














Certainly! I've tried the code above. I just can't get the curve right.

– user11550
Apr 28 '18 at 3:48





Certainly! I've tried the code above. I just can't get the curve right.

– user11550
Apr 28 '18 at 3:48










9 Answers
9






active

oldest

votes


















11














edit:



consider Kpym comments let expanded one "paceman" to set of them with different orientation, size, rotation and colors....



enter image description here



documentclass[tikz, margin=3mm]standalone
usepackagegeometry
usepackagetikz

begindocument
begintikzpicture%[scale=...]
draw[thick,fill=yellow]
(0,0) -- (30:1cm) arc (30:330:1cm) -- cycle;
fill (0,0.66) circle (1.5mm);
endtikzpicturequad
begintikzpicture[xscale=-1]
draw[thick,fill=yellow]
(0,0) -- (30:1cm) arc (30:330:1cm) -- cycle;
fill (0,2/3) circle (1.5mm);
endtikzpicturequad
begintikzpicture[scale=-1]
draw[thick,fill=yellow]
(0,0) -- (30:1cm) arc (30:330:1cm) -- cycle;
fill (0,2/3) circle (1.5mm);
endtikzpicturequad
begintikzpicture[yscale=-1]
draw[thick,fill=yellow]
(0,0) -- (30:1cm) arc (30:330:1cm) -- cycle;
fill (0,2/3) circle (1.5mm);
endtikzpicturequad
begintikzpicture[scale=0.75,rotate=-45]
draw[thick,fill=yellow!50!orange]
(0,0) -- (30:1cm) arc (30:330:1cm) -- cycle;
fill (0,2/3) circle (1.5mm);
endtikzpicturequad
begintikzpicture[xscale=-0.75,yscale=0.75, rotate=45]
draw[thick,fill=orange]
(0,0) -- (30:1cm) arc (30:330:1cm) -- cycle;
fill (0,2/3) circle (1.5mm);
endtikzpicturequad
begintikzpicture[scale=-0.75, rotate=90]
draw[thick,fill=olive]
(0,0) -- (30:1cm) arc (30:330:1cm) -- cycle;
fill (0,2/3) circle (1.5mm);
endtikzpicture
enddocument


size and orientation of "pacman" (as you can see) you can adopt to your wishes with scaling with scale=..., xscale=..., yscale=..., rotate=... in any combination.



edit (2):



meanwhile marmot exploit Kpym idea to draw "paceman" as pic in his comment below, so he spare some mine work [to copy provided solution to my answer] :-). another idea is to define "paceman" as newcommand and use it in document also out of tikzpicture environment:



 documentclassarticle
usepackagegeometry
usepackagetikz

newcommandpacman[2]tikz[baseline, #1]%
draw[thick,fill=#2]
(0,0) -- (30:1cm) arc (30:330:1cm) -- cycle;
fill (0,2/3) circle (1.5mm);

begindocument
pacmanscale=1yellowquad
pacmanxscale=-1yellowquad
pacmanscale=-1yellowquad
pacmanyscale=-1yellowquad

begintikzpicture
pacmanscale=0.75,rotate=-45yellow!50!orangequad
pacmanxscale=-0.75,yscale=0.75, rotate=45orange
endtikzpicture
enddocument


enter image description here






share|improve this answer




















  • 1





    For code golfing tikzdraw[thick,fill=yellow](0,0)--(30:1)arc(30:330:1)--cycle;fill(0,2/3)circle (.15); your solution is ;)

    – Kpym
    Apr 28 '18 at 5:22











  • Thanks! I also want to draw a Pacman that faces the opposite direction. I tried both 150:210 and 210:150, but neither works. What should I do?

    – user11550
    Apr 28 '18 at 5:32











  • @user11550 you can simply add [yscale=-1] to obtain the opposite direction. And if you want to turn it [rotate=...]. Both can be combined like this [yscale=-1,rotate=...]

    – Kpym
    Apr 28 '18 at 7:21











  • @Kpym, thank you very much for all suggestions! i consider them in edited answer. thank you again.

    – Zarko
    Apr 28 '18 at 9:11











  • @user11550, see edited answer.

    – Zarko
    Apr 28 '18 at 9:19


















39














documentclass[border = 5pt, tikz]standalone

usepackagexcolor-material

% from https://tex.stackexchange.com/questions/413389/how-to-make-a-simple-drawing-of-an-apple-using-only-the-tikz-library
usetikzlibraryfit
tikzset%
apple/.pic=
fill [MaterialBrown] (-1/8,0)
arc (180:120:1 and 3/2) coordinate [pos=3/5] (@)-- ++(1/6,-1/7)
arc (120:180:5/4 and 3/2) -- cycle;
fill [MaterialLightGreen500] (0,-9/10)
.. controls ++(180:1/8) and ++( 0:1/4) .. (-1/3, -1)
.. controls ++(180:1/3) and ++(270:1/2) .. ( -1, 0)
.. controls ++( 90:1/3) and ++(180:1/3) .. (-1/2, 3/4)
.. controls ++( 0:1/8) and ++(135:1/8) .. ( 0, 4/7)
.. controls ++( 45:1/8) and ++(180:1/8) .. ( 1/2, 3/4)
.. controls ++( 0:1/3) and ++( 90:1/3) .. ( 1, 0)
.. controls ++(270:1/2) and ++( 0:1/3) .. ( 1/3, -1)
.. controls ++(180:1/4) and ++( 0:1/8) .. cycle;
fill [MaterialLightGreen600] (0, 4/7)
.. controls ++( 45:1/8) and ++(180:1/8) .. ( 1/2, 3/4)
.. controls ++( 0:1/3) and ++( 90:1/3) .. ( 1, 0)
.. controls ++(270:1/2) and ++( 0:1/3) .. ( 1/3, -1)
.. controls ++(180:1/4) and ++( 0:1/8) .. ( 0,-9/10);
fill [MaterialGreen500, shift=(@), rotate=-30]
(0,0) arc (45:135:3/4 and 3/5) arc (225:315:3/4 and 3/5);
fill [MaterialGreen700, shift=(@), rotate=-30]
(0,0) arc (315:225:3/4 and 3/5) -- cycle;
,
cherry/.pic=
foreach i in 1,2
tikzsetshift=(-1+i*3/4, -3/5+i/5),scale=1/2, rotate=15-i*10
fill [MaterialRed700] (0,19/20)
.. controls ++(180:1/8) and ++( 0:1/4) .. (-1/3, 1)
.. controls ++(180:1/3) and ++( 90:1/2) .. ( -1, 0)
.. controls ++(270:1/2) and ++(180:1/2) .. ( 0, -1)
.. controls ++( 0:1/2) and ++(270:1/2) .. ( 1, 0)
.. controls ++( 90:1/2) and ++( 0:1/3) .. ( 1/3, 1)
.. controls ++(180:1/4) and ++( 0:1/8) .. cycle;
fill [MaterialRed800] (0, -1)
.. controls ++( 0:1/2) and ++(270:1/2) .. ( 1, 0)
.. controls ++( 90:1/2) and ++( 0:1/3) .. ( 1/3, 1)
.. controls ++(180:1/4) and ++( 0:1/8) .. ( 0,19/20) -- cycle;
fill [MaterialRed900] (0,3/4) coordinate (@i)
ellipse [x radius=1/4, y radius=1/8];

fill [MaterialBrown]
(1/4,11/8) -- (3/8,11/8) coordinate (@)
.. controls ++(270:1/2) and ++(135:1/3) .. (@1)
.. controls ++(135:1/2) and ++(270:1/2) .. cycle;
fill [MaterialBrown]
(1/4,11/8) -- (3/8,11/8)
.. controls ++(315:1/2) and ++(45:1/2) .. (@2)
.. controls ++(60:1/2) and ++(315:1/2) .. cycle;
fill [MaterialGreen500, shift=(@), rotate=20]
(0,0) arc (45:135:3/4 and 3/5) arc (225:315:3/4 and 3/5);
fill [MaterialGreen700, shift=(@), rotate=20]
(0,0) arc (315:225:3/4 and 3/5) -- cycle;


newcountnframes
nframes=80

begindocument

foreach n in 0,...,nframes

begintikzpicture
pgfmathsetmacrox10.0 * n / nframes
pgfmathsetmacroangle5 + 25 * abs(sin(3 * 360 * (n / nframes)))
clip (-1, -1.2) rectangle (10, 1.2);

% food
beginscope
clip (x, -1.2) rectangle (10, 1.2);
foreach i in 0,...,10

ifnumi=5 path (8, 0) pic[scale = 0.4] apple;
else ifnumi=8 path (5, 0) pic[scale = 0.4] cherry;
else fill[gray, opacity = 0.3] (i, 0) circle (0.2);
fi fi

endscope


% pacman
beginscope[xshift = x cm]
draw[thick,fill = yellow]
(0,0) -- ++ (angle:1cm) arc (angle:360-angle:1cm) -- cycle;
fill (0,0.66) circle (1.5mm);
endscope

endtikzpicture

enddocument


enter image description here




EDIT: Thanks to @UlrikeFischer for the suggestion :)



enter image description here



newcommandinterrupted%

pgfmathsetmacrodx11.0 / 7.0
foreach i/c in 0/gray,1/yellow,2/cyan,3/green,4/magenta,5/red,6/blue
fill[c] (i * dx - 1, -0.4) rectangle (i * dx + dx - 1, 1.2);

foreach i/c in 0/blue,1/black,2/magenta,3/black,4/cyan,5/black,6/white
fill[c] (i * dx - 1, -0.6) rectangle (i * dx + dx - 1, -0.4);


pgfmathsetmacrodx11.0 / 6.0
foreach i/c in 0/blue!40!black,1/white,2/blue,3/black,4/black!80,5/black
fill[c] (i * dx - 1, -1.2) rectangle (i * dx + dx - 1, -0.6);

node[white] at (5.5, 0) textbfNo ducks were harmed in this test



And add this to the main loop



pgfmathsetmacroswitchlx > 4.0
pgfmathsetmacroswitchrx < 6.0
ifnumswitchl=1 ifnumswitchr=1
interrupted;
fifi





share|improve this answer




















  • 7





    Nice. Next step : integrate script version in a way that we can play Packman in PDF ;)

    – Kpym
    Apr 28 '18 at 9:54






  • 5





    I was worried for a minute!

    – Paulo Cereda
    Apr 28 '18 at 11:15






  • 3





    You should prove that the duck was not harmed. It could reappear after the pacman ;-)

    – Ulrike Fischer
    Apr 28 '18 at 11:27






  • 1





    A very cool animation!

    – Dr. Manuel Kuehner
    Apr 28 '18 at 13:04






  • 5





    Great answer! I created a version with reverted roles: i.stack.imgur.com/gImlU.gif

    – user36296
    Apr 28 '18 at 13:58


















39














I think you misinterpret what the in and out syntax does. You may want to use arc.



documentclass[tikz,border=3.14mm]standalone
tikzset
Pacman/.pic=
shadedraw[inner color=yellow,outer color=yellow!80!black,draw=black,thick]
(0,0) -- (40:2) arc(40:320:2) -- cycle;
fill (0,1) circle (0.3);



begindocument
begintikzpicture
pic Pacman;
pic[xscale=-1] at (5,0) Pacman;
endtikzpicture
enddocument


enter image description here



Anyway, here is a 3D version.



documentclass[tikz,border=3.14mm]standalone
tikzsetPacman/.pic=
fill (0,0) to[out=1.75*#1,in=180-0.25*#1] (0.92*#1:2)
to[out=-180+0.25*#1,in=1.75*#1,looseness=0.5] (1,0)
to[out=-1.75*#1,in=180-0.25*#1,looseness=0.5] (-0.92*#1:2)
to [out=-180+0.25*#1,in=-1.75*#1] cycle;
shadedraw[ball color=yellow,thick]
(0,0) to[out=1.75*#1,in=180-0.25*#1] (0.92*#1:2)
arc(0.92*#1:360-0.92*#1:2) to [out=-180+0.25*#1,in=-1.75*#1]
cycle;
fill (0.3-0.01*#1,1) circle (0.3);



begindocument
begintikzpicture
pic Pacman=50;
pic[xscale=-1] at (5,0) Pacman=20;
endtikzpicture
enddocument


enter image description here



EDIT: Added backwards facing Pacman and used pic and added 3D.



2nd EDIT: Inspired by samcarter, who got inspired by caverac: a 3D animation using this answer.



documentclassarticle

usepackageanimate

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
usepackage[active,tightpage]preview
makeatletter
def@anim@@newframe@ifstar@anim@newframe@anim@newframe
def@anim@newframeendpreviewbeginpreview
renewenvironmentanimateinline[2][]%
letnewframe@anim@@newframe%
letmultiframe@anim@multiframe%
beginpreview%
endpreview
makeatother
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
usepackagetikz
usepgfmodulenonlineartransformations
usetikzlibraryshapes
usetikzlibrarypatterns
makeatletter
% from https://tex.stackexchange.com/q/56353/121799
newcommandgettikzxy[3]%
tikz@scan@one@pointpgfutil@firstofone#1relax
globaledef#2thepgf@x%
globaledef#3thepgf@y%

% from the manual section 103.4.2
% pgf@x will contain the xoutradius angle
% pgf@y will contain the distance pgfmathsincos@pgf@sys@tonumberpgf@x%
% pgfmathresultx is now the cosine of xoutradius radius and
% pgfmathresulty is the sine of radius
% pgf@x=pgfmathresultxpgf@y%
% pgf@y=pgfmathresultypgf@y%
% what the thing in the pgf manually is probably doing it to express the x coordinate in pt
% then take the cos and sin of x/pt (i.e. if x=50pt then it will return cos(50))
% and multiply the outcome by a the y coordinate
% (x_new,y_new) = (y_old cos(x_old/pt), y_old sin(x_old/pt))
% now comes a slightly modified version
defmarmotransformation% modified version of the manual 103.4.2 Installing Nonlinear Transformation
advancepgf@x by -xC% relative
advancepgf@y by -yC% coorinates
edefrelXthepgf@x%
edefrelYthepgf@y% Yes, there is a more elegant solution based on pgfpointadd
pgfmathsetmacrorelNxxN-xC%
pgfmathsetmacrorelNyyN-yC%
pgfmathsetmacroangleNatan2(relNy,relNx)%
pgfmathsetmacroLeNveclen(relNx,relNy)%
pgfmathsetmacromyp(relX*relNx+relY*relNy)/(LeN*28.3465)
pgfmathsetmacromyo(((relY*relNx-relX*relNy))/(myp*LeN*(28.3465*pi/180)))+angleN)
pgfpointaddpgfqpointxCyCpgfpointpolarxymyomyp



begindocument
beginanimateinline[autoplay,loop]2
multiframe21i=0+1pgfmathsetmacromyangle60-5*abs(i-10)
begintikzpicture[ball color=red]
%pic[scale=2] at (-6.5,0) Pacman=myangle;
beginscope[xshift=-(6.5-0.4*i)*1cm,scale=2]
fill (0,0) to[out=1.75*myangle,in=180-0.25*myangle] (0.92*myangle:2)
to[out=-180+0.25*myangle,in=1.75*myangle,looseness=0.5] (1,0)
to[out=-1.75*myangle,in=180-0.25*myangle,looseness=0.5]
(-0.92*myangle:2) to [out=-180+0.25*myangle,in=-1.75*myangle] cycle;
endscope
%
coordinate (C) at (0,3) ;
gettikzxy(C)xCyC
coordinate (N) at (0,0) ;
gettikzxy(N)xNyN
beginscope[transform shape nonlinear=true]
pgftransformnonlinearmarmotransformation
shade[shading=ball,opacity=1] (0,0) circle (2);
endscope
draw[smooth,fill=black](-0.15,3) .. controls (-0.15,2.5) .. (0,2) to
(0.1,2) .. controls (-0.05,2.5) .. (-0.05,3) --cycle;
%
beginscope[xshift=-(6.5-0.4*i)*1cm,scale=2]
shadedraw[ball color=yellow,thick]
(0,0) to[out=1.75*myangle,in=180-0.25*myangle] (0.92*myangle:2)
arc(0.92*myangle:360-0.92*myangle:2) to [out=-180+0.25*myangle,in=-1.75*myangle]
cycle;
fill (0.3-0.01*myangle,1) circle (0.3);
endscope
path[use as bounding box](-8,-2) rectangle 4,2);
endtikzpicture

endanimateinline
enddocument


enter image description here






share|improve this answer

























  • Thanks! I also want to draw a Pacman that faces the opposite direction. I tried both 140:220 and 220:140, but neither works. What should I do?

    – user11550
    Apr 28 '18 at 5:38






  • 1





    @user11550 (0,0) -- (140:2) arc(140:-140:2) -- cycle;

    – Ignasi
    Apr 28 '18 at 7:47











  • @user11550 I added a Pacman facing in opposite direction.

    – marmot
    Apr 28 '18 at 11:09






  • 2





    This looks like it belongs on the fishing channel!

    – Steven B. Segletes
    Apr 30 '18 at 10:29











  • @StevenB.Segletes Done.

    – marmot
    Jul 31 '18 at 23:05


















19














A picture version just to impress David Carlisle ;)



documentclass[border=7pt]standalone
usepackagecolor
begindocument
setlengthunitlength.5pt
beginpicture(200,200)(-100,-100)
qbezier(0,0)(43.5, 25)(87, 50)
qbezier(87, 50)(58, 100)(0, 100)
qbezier(0, 100)(-58, 100)(-87, 50)
qbezier(-87, 50)(-115, 0)(-87, -50)
qbezier(-87, -50)(-58, -100)(0, -100)
qbezier(0, -100)(58, -100)(87, -50)
qbezier(87, -50)(43.5, -25)(0, 0)
colorred
put(0,67)circle*30
endpicture
enddocument


enter image description here






share|improve this answer























  • well, you impress me too! (+1)

    – Zarko
    Apr 28 '18 at 9:28











  • And me too! :):):)

    – CarLaTeX
    Apr 28 '18 at 9:38






  • 11





    +1 strike against the tikz mafia:-)

    – David Carlisle
    Apr 28 '18 at 9:38











  • @DavidCarlisle the revolution is coming 50 years after May '68 ;)

    – Kpym
    Apr 28 '18 at 9:51


















15














An alternative solution with tkz-euclide, unfortunately the documentation is in French only, but there are many examples very easy to understand.



documentclassarticle
usepackagetkz-euclide
usetkzobjall

begindocument
begintikzpicture
tkzDefPoint(0,0)O
tkzDefPoint(0,1)A
tkzDrawSector[R,draw=black,thick,fill=yellow](O,2cm)(30,330)
tkzDrawCircle[R, fill=black](A,.3cm)
tkzDefPoint(4.5,0)O2
tkzDefPoint(4.5,1)A2
tkzDrawSector[R,draw=black,thick,fill=yellow](O2,2cm)(210,150)
tkzDrawCircle[R, fill=black](A2,.3cm)
endtikzpicture
enddocument


enter image description here






share|improve this answer























  • nice (+1)! i'm not familiar tkz-euclide, but now see one reason more why make me more familiar with it :-)

    – Zarko
    Apr 28 '18 at 9:21






  • 4





    @Zarko Thank you! I think the package would be more popular if there was an English documentation :):):)

    – CarLaTeX
    Apr 28 '18 at 9:34


















6














Ascii verbatim version.



documentclass[preview]standalone
begindocument
ttfamilytiny
beginverbatim


`..--:::::--..`
`-/+osssoo++++++++oosssso+/-`
-/osso/::-------------------::+osso/.
`:oyo+:-------------------------------:+syo:`
`:syo:----------------:/+++/-----------------/oyo-
.+yo:-----------------:ymNMMMNms:-----------------/sy/`
.oy+-------------------:mMMMMMMMMMd-------------------:oy+`
`oy+---------------------sMMMMMMMMMMM+---------------------oh/`
:ho-----------------------+MMMMMMMMMMN:----------------------:sy-
`oh:-------------------------omMMMMMMMm+-------------------------/h+
.hs----------------------------:+shhhs+----------------------------:hy
.do---------------------------------------------------------------:oys/`
.d+------------------------------------------------------------:/syo:`
`ho----------------------------------------------------------:+ys+-
oh--------------------------------------------------------/oyo:`
.N:----------------------------------------------------:+sy+-
ys--------------------------------------------------:oys/.
`N:-----------------------------------------------+syo-
/d--------------------------------------------:oys/.
sy-----------------------------------------/syo:
ys-------------------------------------:oyy+.
ys--------------------------------------oyy+.
sy-----------------------------------------/sys:`
/d--------------------------------------------:oyy+.
`N:-----------------------------------------------/syo:`
ys--------------------------------------------------:oys/.
.N:----------------------------------------------------:+syo-
oh--------------------------------------------------------/oys/.
`ho----------------------------------------------------------:+ss+-
.d+------------------------------------------------------------:/syo:`
.do---------------------------------------------------------------:oss+`
.hs----------------------------------------------------------------:hs
`oh:-------------------------------------------------------------/h+
:ho----------------------------------------------------------:sy-
`+h+-------------------------------------------------------oh/`
.oy+--------------------------------------------------:oy+`
.+yo/---------------------------------------------/sy/`
`:syo:---------------------------------------/oyo-
`:oys+:-------------------------------:+sso:`
-/osso+::-------------------:/+osso:.
`-/+ossssoo+++++++oosssso+:-`
`..--:::::--.``


endverbatim
enddocument


enter image description here






share|improve this answer






























    5














    Code golfing version.



    documentclass[tikz,border=7pt]standalone
    begindocument
    tikzdraw[thick,fill=yellow](0,0)--(30:1)arc(30:330:1)--cycle;fill(0,2/3)circle(.15);
    enddocument


    enter image description here






    share|improve this answer






























      4














      Plain Metapost version:



      prologues := 3;
      outputtemplate := "%j%c.eps";
      beginfig(1);
      path P;
      P = origin -- subpath 1/2(1,15) of fullcircle scaled 42 -- cycle;
      fill P withcolor red+green; draw P;
      fill fullcircle scaled 7 shifted 14 up;
      endfig;
      end.


      enter image description here






      share|improve this answer
































        3














        A trivial solution with PSTricks.



        documentclass[pstricks]standalone
        begindocument
        pspicture(6,6)
        pswedge[fillstyle=solid,fillcolor=yellow](3,3)315345
        qdisk(3.5,4.5).5
        endpspicture
        enddocument


        enter image description here






        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',
          autoActivateHeartbeat: false,
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          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%2f428967%2fpacman-circle-in-tikz%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          9 Answers
          9






          active

          oldest

          votes








          9 Answers
          9






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          11














          edit:



          consider Kpym comments let expanded one "paceman" to set of them with different orientation, size, rotation and colors....



          enter image description here



          documentclass[tikz, margin=3mm]standalone
          usepackagegeometry
          usepackagetikz

          begindocument
          begintikzpicture%[scale=...]
          draw[thick,fill=yellow]
          (0,0) -- (30:1cm) arc (30:330:1cm) -- cycle;
          fill (0,0.66) circle (1.5mm);
          endtikzpicturequad
          begintikzpicture[xscale=-1]
          draw[thick,fill=yellow]
          (0,0) -- (30:1cm) arc (30:330:1cm) -- cycle;
          fill (0,2/3) circle (1.5mm);
          endtikzpicturequad
          begintikzpicture[scale=-1]
          draw[thick,fill=yellow]
          (0,0) -- (30:1cm) arc (30:330:1cm) -- cycle;
          fill (0,2/3) circle (1.5mm);
          endtikzpicturequad
          begintikzpicture[yscale=-1]
          draw[thick,fill=yellow]
          (0,0) -- (30:1cm) arc (30:330:1cm) -- cycle;
          fill (0,2/3) circle (1.5mm);
          endtikzpicturequad
          begintikzpicture[scale=0.75,rotate=-45]
          draw[thick,fill=yellow!50!orange]
          (0,0) -- (30:1cm) arc (30:330:1cm) -- cycle;
          fill (0,2/3) circle (1.5mm);
          endtikzpicturequad
          begintikzpicture[xscale=-0.75,yscale=0.75, rotate=45]
          draw[thick,fill=orange]
          (0,0) -- (30:1cm) arc (30:330:1cm) -- cycle;
          fill (0,2/3) circle (1.5mm);
          endtikzpicturequad
          begintikzpicture[scale=-0.75, rotate=90]
          draw[thick,fill=olive]
          (0,0) -- (30:1cm) arc (30:330:1cm) -- cycle;
          fill (0,2/3) circle (1.5mm);
          endtikzpicture
          enddocument


          size and orientation of "pacman" (as you can see) you can adopt to your wishes with scaling with scale=..., xscale=..., yscale=..., rotate=... in any combination.



          edit (2):



          meanwhile marmot exploit Kpym idea to draw "paceman" as pic in his comment below, so he spare some mine work [to copy provided solution to my answer] :-). another idea is to define "paceman" as newcommand and use it in document also out of tikzpicture environment:



           documentclassarticle
          usepackagegeometry
          usepackagetikz

          newcommandpacman[2]tikz[baseline, #1]%
          draw[thick,fill=#2]
          (0,0) -- (30:1cm) arc (30:330:1cm) -- cycle;
          fill (0,2/3) circle (1.5mm);

          begindocument
          pacmanscale=1yellowquad
          pacmanxscale=-1yellowquad
          pacmanscale=-1yellowquad
          pacmanyscale=-1yellowquad

          begintikzpicture
          pacmanscale=0.75,rotate=-45yellow!50!orangequad
          pacmanxscale=-0.75,yscale=0.75, rotate=45orange
          endtikzpicture
          enddocument


          enter image description here






          share|improve this answer




















          • 1





            For code golfing tikzdraw[thick,fill=yellow](0,0)--(30:1)arc(30:330:1)--cycle;fill(0,2/3)circle (.15); your solution is ;)

            – Kpym
            Apr 28 '18 at 5:22











          • Thanks! I also want to draw a Pacman that faces the opposite direction. I tried both 150:210 and 210:150, but neither works. What should I do?

            – user11550
            Apr 28 '18 at 5:32











          • @user11550 you can simply add [yscale=-1] to obtain the opposite direction. And if you want to turn it [rotate=...]. Both can be combined like this [yscale=-1,rotate=...]

            – Kpym
            Apr 28 '18 at 7:21











          • @Kpym, thank you very much for all suggestions! i consider them in edited answer. thank you again.

            – Zarko
            Apr 28 '18 at 9:11











          • @user11550, see edited answer.

            – Zarko
            Apr 28 '18 at 9:19















          11














          edit:



          consider Kpym comments let expanded one "paceman" to set of them with different orientation, size, rotation and colors....



          enter image description here



          documentclass[tikz, margin=3mm]standalone
          usepackagegeometry
          usepackagetikz

          begindocument
          begintikzpicture%[scale=...]
          draw[thick,fill=yellow]
          (0,0) -- (30:1cm) arc (30:330:1cm) -- cycle;
          fill (0,0.66) circle (1.5mm);
          endtikzpicturequad
          begintikzpicture[xscale=-1]
          draw[thick,fill=yellow]
          (0,0) -- (30:1cm) arc (30:330:1cm) -- cycle;
          fill (0,2/3) circle (1.5mm);
          endtikzpicturequad
          begintikzpicture[scale=-1]
          draw[thick,fill=yellow]
          (0,0) -- (30:1cm) arc (30:330:1cm) -- cycle;
          fill (0,2/3) circle (1.5mm);
          endtikzpicturequad
          begintikzpicture[yscale=-1]
          draw[thick,fill=yellow]
          (0,0) -- (30:1cm) arc (30:330:1cm) -- cycle;
          fill (0,2/3) circle (1.5mm);
          endtikzpicturequad
          begintikzpicture[scale=0.75,rotate=-45]
          draw[thick,fill=yellow!50!orange]
          (0,0) -- (30:1cm) arc (30:330:1cm) -- cycle;
          fill (0,2/3) circle (1.5mm);
          endtikzpicturequad
          begintikzpicture[xscale=-0.75,yscale=0.75, rotate=45]
          draw[thick,fill=orange]
          (0,0) -- (30:1cm) arc (30:330:1cm) -- cycle;
          fill (0,2/3) circle (1.5mm);
          endtikzpicturequad
          begintikzpicture[scale=-0.75, rotate=90]
          draw[thick,fill=olive]
          (0,0) -- (30:1cm) arc (30:330:1cm) -- cycle;
          fill (0,2/3) circle (1.5mm);
          endtikzpicture
          enddocument


          size and orientation of "pacman" (as you can see) you can adopt to your wishes with scaling with scale=..., xscale=..., yscale=..., rotate=... in any combination.



          edit (2):



          meanwhile marmot exploit Kpym idea to draw "paceman" as pic in his comment below, so he spare some mine work [to copy provided solution to my answer] :-). another idea is to define "paceman" as newcommand and use it in document also out of tikzpicture environment:



           documentclassarticle
          usepackagegeometry
          usepackagetikz

          newcommandpacman[2]tikz[baseline, #1]%
          draw[thick,fill=#2]
          (0,0) -- (30:1cm) arc (30:330:1cm) -- cycle;
          fill (0,2/3) circle (1.5mm);

          begindocument
          pacmanscale=1yellowquad
          pacmanxscale=-1yellowquad
          pacmanscale=-1yellowquad
          pacmanyscale=-1yellowquad

          begintikzpicture
          pacmanscale=0.75,rotate=-45yellow!50!orangequad
          pacmanxscale=-0.75,yscale=0.75, rotate=45orange
          endtikzpicture
          enddocument


          enter image description here






          share|improve this answer




















          • 1





            For code golfing tikzdraw[thick,fill=yellow](0,0)--(30:1)arc(30:330:1)--cycle;fill(0,2/3)circle (.15); your solution is ;)

            – Kpym
            Apr 28 '18 at 5:22











          • Thanks! I also want to draw a Pacman that faces the opposite direction. I tried both 150:210 and 210:150, but neither works. What should I do?

            – user11550
            Apr 28 '18 at 5:32











          • @user11550 you can simply add [yscale=-1] to obtain the opposite direction. And if you want to turn it [rotate=...]. Both can be combined like this [yscale=-1,rotate=...]

            – Kpym
            Apr 28 '18 at 7:21











          • @Kpym, thank you very much for all suggestions! i consider them in edited answer. thank you again.

            – Zarko
            Apr 28 '18 at 9:11











          • @user11550, see edited answer.

            – Zarko
            Apr 28 '18 at 9:19













          11












          11








          11







          edit:



          consider Kpym comments let expanded one "paceman" to set of them with different orientation, size, rotation and colors....



          enter image description here



          documentclass[tikz, margin=3mm]standalone
          usepackagegeometry
          usepackagetikz

          begindocument
          begintikzpicture%[scale=...]
          draw[thick,fill=yellow]
          (0,0) -- (30:1cm) arc (30:330:1cm) -- cycle;
          fill (0,0.66) circle (1.5mm);
          endtikzpicturequad
          begintikzpicture[xscale=-1]
          draw[thick,fill=yellow]
          (0,0) -- (30:1cm) arc (30:330:1cm) -- cycle;
          fill (0,2/3) circle (1.5mm);
          endtikzpicturequad
          begintikzpicture[scale=-1]
          draw[thick,fill=yellow]
          (0,0) -- (30:1cm) arc (30:330:1cm) -- cycle;
          fill (0,2/3) circle (1.5mm);
          endtikzpicturequad
          begintikzpicture[yscale=-1]
          draw[thick,fill=yellow]
          (0,0) -- (30:1cm) arc (30:330:1cm) -- cycle;
          fill (0,2/3) circle (1.5mm);
          endtikzpicturequad
          begintikzpicture[scale=0.75,rotate=-45]
          draw[thick,fill=yellow!50!orange]
          (0,0) -- (30:1cm) arc (30:330:1cm) -- cycle;
          fill (0,2/3) circle (1.5mm);
          endtikzpicturequad
          begintikzpicture[xscale=-0.75,yscale=0.75, rotate=45]
          draw[thick,fill=orange]
          (0,0) -- (30:1cm) arc (30:330:1cm) -- cycle;
          fill (0,2/3) circle (1.5mm);
          endtikzpicturequad
          begintikzpicture[scale=-0.75, rotate=90]
          draw[thick,fill=olive]
          (0,0) -- (30:1cm) arc (30:330:1cm) -- cycle;
          fill (0,2/3) circle (1.5mm);
          endtikzpicture
          enddocument


          size and orientation of "pacman" (as you can see) you can adopt to your wishes with scaling with scale=..., xscale=..., yscale=..., rotate=... in any combination.



          edit (2):



          meanwhile marmot exploit Kpym idea to draw "paceman" as pic in his comment below, so he spare some mine work [to copy provided solution to my answer] :-). another idea is to define "paceman" as newcommand and use it in document also out of tikzpicture environment:



           documentclassarticle
          usepackagegeometry
          usepackagetikz

          newcommandpacman[2]tikz[baseline, #1]%
          draw[thick,fill=#2]
          (0,0) -- (30:1cm) arc (30:330:1cm) -- cycle;
          fill (0,2/3) circle (1.5mm);

          begindocument
          pacmanscale=1yellowquad
          pacmanxscale=-1yellowquad
          pacmanscale=-1yellowquad
          pacmanyscale=-1yellowquad

          begintikzpicture
          pacmanscale=0.75,rotate=-45yellow!50!orangequad
          pacmanxscale=-0.75,yscale=0.75, rotate=45orange
          endtikzpicture
          enddocument


          enter image description here






          share|improve this answer















          edit:



          consider Kpym comments let expanded one "paceman" to set of them with different orientation, size, rotation and colors....



          enter image description here



          documentclass[tikz, margin=3mm]standalone
          usepackagegeometry
          usepackagetikz

          begindocument
          begintikzpicture%[scale=...]
          draw[thick,fill=yellow]
          (0,0) -- (30:1cm) arc (30:330:1cm) -- cycle;
          fill (0,0.66) circle (1.5mm);
          endtikzpicturequad
          begintikzpicture[xscale=-1]
          draw[thick,fill=yellow]
          (0,0) -- (30:1cm) arc (30:330:1cm) -- cycle;
          fill (0,2/3) circle (1.5mm);
          endtikzpicturequad
          begintikzpicture[scale=-1]
          draw[thick,fill=yellow]
          (0,0) -- (30:1cm) arc (30:330:1cm) -- cycle;
          fill (0,2/3) circle (1.5mm);
          endtikzpicturequad
          begintikzpicture[yscale=-1]
          draw[thick,fill=yellow]
          (0,0) -- (30:1cm) arc (30:330:1cm) -- cycle;
          fill (0,2/3) circle (1.5mm);
          endtikzpicturequad
          begintikzpicture[scale=0.75,rotate=-45]
          draw[thick,fill=yellow!50!orange]
          (0,0) -- (30:1cm) arc (30:330:1cm) -- cycle;
          fill (0,2/3) circle (1.5mm);
          endtikzpicturequad
          begintikzpicture[xscale=-0.75,yscale=0.75, rotate=45]
          draw[thick,fill=orange]
          (0,0) -- (30:1cm) arc (30:330:1cm) -- cycle;
          fill (0,2/3) circle (1.5mm);
          endtikzpicturequad
          begintikzpicture[scale=-0.75, rotate=90]
          draw[thick,fill=olive]
          (0,0) -- (30:1cm) arc (30:330:1cm) -- cycle;
          fill (0,2/3) circle (1.5mm);
          endtikzpicture
          enddocument


          size and orientation of "pacman" (as you can see) you can adopt to your wishes with scaling with scale=..., xscale=..., yscale=..., rotate=... in any combination.



          edit (2):



          meanwhile marmot exploit Kpym idea to draw "paceman" as pic in his comment below, so he spare some mine work [to copy provided solution to my answer] :-). another idea is to define "paceman" as newcommand and use it in document also out of tikzpicture environment:



           documentclassarticle
          usepackagegeometry
          usepackagetikz

          newcommandpacman[2]tikz[baseline, #1]%
          draw[thick,fill=#2]
          (0,0) -- (30:1cm) arc (30:330:1cm) -- cycle;
          fill (0,2/3) circle (1.5mm);

          begindocument
          pacmanscale=1yellowquad
          pacmanxscale=-1yellowquad
          pacmanscale=-1yellowquad
          pacmanyscale=-1yellowquad

          begintikzpicture
          pacmanscale=0.75,rotate=-45yellow!50!orangequad
          pacmanxscale=-0.75,yscale=0.75, rotate=45orange
          endtikzpicture
          enddocument


          enter image description here







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Apr 28 '18 at 11:47

























          answered Apr 28 '18 at 3:50









          ZarkoZarko

          129k868169




          129k868169







          • 1





            For code golfing tikzdraw[thick,fill=yellow](0,0)--(30:1)arc(30:330:1)--cycle;fill(0,2/3)circle (.15); your solution is ;)

            – Kpym
            Apr 28 '18 at 5:22











          • Thanks! I also want to draw a Pacman that faces the opposite direction. I tried both 150:210 and 210:150, but neither works. What should I do?

            – user11550
            Apr 28 '18 at 5:32











          • @user11550 you can simply add [yscale=-1] to obtain the opposite direction. And if you want to turn it [rotate=...]. Both can be combined like this [yscale=-1,rotate=...]

            – Kpym
            Apr 28 '18 at 7:21











          • @Kpym, thank you very much for all suggestions! i consider them in edited answer. thank you again.

            – Zarko
            Apr 28 '18 at 9:11











          • @user11550, see edited answer.

            – Zarko
            Apr 28 '18 at 9:19












          • 1





            For code golfing tikzdraw[thick,fill=yellow](0,0)--(30:1)arc(30:330:1)--cycle;fill(0,2/3)circle (.15); your solution is ;)

            – Kpym
            Apr 28 '18 at 5:22











          • Thanks! I also want to draw a Pacman that faces the opposite direction. I tried both 150:210 and 210:150, but neither works. What should I do?

            – user11550
            Apr 28 '18 at 5:32











          • @user11550 you can simply add [yscale=-1] to obtain the opposite direction. And if you want to turn it [rotate=...]. Both can be combined like this [yscale=-1,rotate=...]

            – Kpym
            Apr 28 '18 at 7:21











          • @Kpym, thank you very much for all suggestions! i consider them in edited answer. thank you again.

            – Zarko
            Apr 28 '18 at 9:11











          • @user11550, see edited answer.

            – Zarko
            Apr 28 '18 at 9:19







          1




          1





          For code golfing tikzdraw[thick,fill=yellow](0,0)--(30:1)arc(30:330:1)--cycle;fill(0,2/3)circle (.15); your solution is ;)

          – Kpym
          Apr 28 '18 at 5:22





          For code golfing tikzdraw[thick,fill=yellow](0,0)--(30:1)arc(30:330:1)--cycle;fill(0,2/3)circle (.15); your solution is ;)

          – Kpym
          Apr 28 '18 at 5:22













          Thanks! I also want to draw a Pacman that faces the opposite direction. I tried both 150:210 and 210:150, but neither works. What should I do?

          – user11550
          Apr 28 '18 at 5:32





          Thanks! I also want to draw a Pacman that faces the opposite direction. I tried both 150:210 and 210:150, but neither works. What should I do?

          – user11550
          Apr 28 '18 at 5:32













          @user11550 you can simply add [yscale=-1] to obtain the opposite direction. And if you want to turn it [rotate=...]. Both can be combined like this [yscale=-1,rotate=...]

          – Kpym
          Apr 28 '18 at 7:21





          @user11550 you can simply add [yscale=-1] to obtain the opposite direction. And if you want to turn it [rotate=...]. Both can be combined like this [yscale=-1,rotate=...]

          – Kpym
          Apr 28 '18 at 7:21













          @Kpym, thank you very much for all suggestions! i consider them in edited answer. thank you again.

          – Zarko
          Apr 28 '18 at 9:11





          @Kpym, thank you very much for all suggestions! i consider them in edited answer. thank you again.

          – Zarko
          Apr 28 '18 at 9:11













          @user11550, see edited answer.

          – Zarko
          Apr 28 '18 at 9:19





          @user11550, see edited answer.

          – Zarko
          Apr 28 '18 at 9:19











          39














          documentclass[border = 5pt, tikz]standalone

          usepackagexcolor-material

          % from https://tex.stackexchange.com/questions/413389/how-to-make-a-simple-drawing-of-an-apple-using-only-the-tikz-library
          usetikzlibraryfit
          tikzset%
          apple/.pic=
          fill [MaterialBrown] (-1/8,0)
          arc (180:120:1 and 3/2) coordinate [pos=3/5] (@)-- ++(1/6,-1/7)
          arc (120:180:5/4 and 3/2) -- cycle;
          fill [MaterialLightGreen500] (0,-9/10)
          .. controls ++(180:1/8) and ++( 0:1/4) .. (-1/3, -1)
          .. controls ++(180:1/3) and ++(270:1/2) .. ( -1, 0)
          .. controls ++( 90:1/3) and ++(180:1/3) .. (-1/2, 3/4)
          .. controls ++( 0:1/8) and ++(135:1/8) .. ( 0, 4/7)
          .. controls ++( 45:1/8) and ++(180:1/8) .. ( 1/2, 3/4)
          .. controls ++( 0:1/3) and ++( 90:1/3) .. ( 1, 0)
          .. controls ++(270:1/2) and ++( 0:1/3) .. ( 1/3, -1)
          .. controls ++(180:1/4) and ++( 0:1/8) .. cycle;
          fill [MaterialLightGreen600] (0, 4/7)
          .. controls ++( 45:1/8) and ++(180:1/8) .. ( 1/2, 3/4)
          .. controls ++( 0:1/3) and ++( 90:1/3) .. ( 1, 0)
          .. controls ++(270:1/2) and ++( 0:1/3) .. ( 1/3, -1)
          .. controls ++(180:1/4) and ++( 0:1/8) .. ( 0,-9/10);
          fill [MaterialGreen500, shift=(@), rotate=-30]
          (0,0) arc (45:135:3/4 and 3/5) arc (225:315:3/4 and 3/5);
          fill [MaterialGreen700, shift=(@), rotate=-30]
          (0,0) arc (315:225:3/4 and 3/5) -- cycle;
          ,
          cherry/.pic=
          foreach i in 1,2
          tikzsetshift=(-1+i*3/4, -3/5+i/5),scale=1/2, rotate=15-i*10
          fill [MaterialRed700] (0,19/20)
          .. controls ++(180:1/8) and ++( 0:1/4) .. (-1/3, 1)
          .. controls ++(180:1/3) and ++( 90:1/2) .. ( -1, 0)
          .. controls ++(270:1/2) and ++(180:1/2) .. ( 0, -1)
          .. controls ++( 0:1/2) and ++(270:1/2) .. ( 1, 0)
          .. controls ++( 90:1/2) and ++( 0:1/3) .. ( 1/3, 1)
          .. controls ++(180:1/4) and ++( 0:1/8) .. cycle;
          fill [MaterialRed800] (0, -1)
          .. controls ++( 0:1/2) and ++(270:1/2) .. ( 1, 0)
          .. controls ++( 90:1/2) and ++( 0:1/3) .. ( 1/3, 1)
          .. controls ++(180:1/4) and ++( 0:1/8) .. ( 0,19/20) -- cycle;
          fill [MaterialRed900] (0,3/4) coordinate (@i)
          ellipse [x radius=1/4, y radius=1/8];

          fill [MaterialBrown]
          (1/4,11/8) -- (3/8,11/8) coordinate (@)
          .. controls ++(270:1/2) and ++(135:1/3) .. (@1)
          .. controls ++(135:1/2) and ++(270:1/2) .. cycle;
          fill [MaterialBrown]
          (1/4,11/8) -- (3/8,11/8)
          .. controls ++(315:1/2) and ++(45:1/2) .. (@2)
          .. controls ++(60:1/2) and ++(315:1/2) .. cycle;
          fill [MaterialGreen500, shift=(@), rotate=20]
          (0,0) arc (45:135:3/4 and 3/5) arc (225:315:3/4 and 3/5);
          fill [MaterialGreen700, shift=(@), rotate=20]
          (0,0) arc (315:225:3/4 and 3/5) -- cycle;


          newcountnframes
          nframes=80

          begindocument

          foreach n in 0,...,nframes

          begintikzpicture
          pgfmathsetmacrox10.0 * n / nframes
          pgfmathsetmacroangle5 + 25 * abs(sin(3 * 360 * (n / nframes)))
          clip (-1, -1.2) rectangle (10, 1.2);

          % food
          beginscope
          clip (x, -1.2) rectangle (10, 1.2);
          foreach i in 0,...,10

          ifnumi=5 path (8, 0) pic[scale = 0.4] apple;
          else ifnumi=8 path (5, 0) pic[scale = 0.4] cherry;
          else fill[gray, opacity = 0.3] (i, 0) circle (0.2);
          fi fi

          endscope


          % pacman
          beginscope[xshift = x cm]
          draw[thick,fill = yellow]
          (0,0) -- ++ (angle:1cm) arc (angle:360-angle:1cm) -- cycle;
          fill (0,0.66) circle (1.5mm);
          endscope

          endtikzpicture

          enddocument


          enter image description here




          EDIT: Thanks to @UlrikeFischer for the suggestion :)



          enter image description here



          newcommandinterrupted%

          pgfmathsetmacrodx11.0 / 7.0
          foreach i/c in 0/gray,1/yellow,2/cyan,3/green,4/magenta,5/red,6/blue
          fill[c] (i * dx - 1, -0.4) rectangle (i * dx + dx - 1, 1.2);

          foreach i/c in 0/blue,1/black,2/magenta,3/black,4/cyan,5/black,6/white
          fill[c] (i * dx - 1, -0.6) rectangle (i * dx + dx - 1, -0.4);


          pgfmathsetmacrodx11.0 / 6.0
          foreach i/c in 0/blue!40!black,1/white,2/blue,3/black,4/black!80,5/black
          fill[c] (i * dx - 1, -1.2) rectangle (i * dx + dx - 1, -0.6);

          node[white] at (5.5, 0) textbfNo ducks were harmed in this test



          And add this to the main loop



          pgfmathsetmacroswitchlx > 4.0
          pgfmathsetmacroswitchrx < 6.0
          ifnumswitchl=1 ifnumswitchr=1
          interrupted;
          fifi





          share|improve this answer




















          • 7





            Nice. Next step : integrate script version in a way that we can play Packman in PDF ;)

            – Kpym
            Apr 28 '18 at 9:54






          • 5





            I was worried for a minute!

            – Paulo Cereda
            Apr 28 '18 at 11:15






          • 3





            You should prove that the duck was not harmed. It could reappear after the pacman ;-)

            – Ulrike Fischer
            Apr 28 '18 at 11:27






          • 1





            A very cool animation!

            – Dr. Manuel Kuehner
            Apr 28 '18 at 13:04






          • 5





            Great answer! I created a version with reverted roles: i.stack.imgur.com/gImlU.gif

            – user36296
            Apr 28 '18 at 13:58















          39














          documentclass[border = 5pt, tikz]standalone

          usepackagexcolor-material

          % from https://tex.stackexchange.com/questions/413389/how-to-make-a-simple-drawing-of-an-apple-using-only-the-tikz-library
          usetikzlibraryfit
          tikzset%
          apple/.pic=
          fill [MaterialBrown] (-1/8,0)
          arc (180:120:1 and 3/2) coordinate [pos=3/5] (@)-- ++(1/6,-1/7)
          arc (120:180:5/4 and 3/2) -- cycle;
          fill [MaterialLightGreen500] (0,-9/10)
          .. controls ++(180:1/8) and ++( 0:1/4) .. (-1/3, -1)
          .. controls ++(180:1/3) and ++(270:1/2) .. ( -1, 0)
          .. controls ++( 90:1/3) and ++(180:1/3) .. (-1/2, 3/4)
          .. controls ++( 0:1/8) and ++(135:1/8) .. ( 0, 4/7)
          .. controls ++( 45:1/8) and ++(180:1/8) .. ( 1/2, 3/4)
          .. controls ++( 0:1/3) and ++( 90:1/3) .. ( 1, 0)
          .. controls ++(270:1/2) and ++( 0:1/3) .. ( 1/3, -1)
          .. controls ++(180:1/4) and ++( 0:1/8) .. cycle;
          fill [MaterialLightGreen600] (0, 4/7)
          .. controls ++( 45:1/8) and ++(180:1/8) .. ( 1/2, 3/4)
          .. controls ++( 0:1/3) and ++( 90:1/3) .. ( 1, 0)
          .. controls ++(270:1/2) and ++( 0:1/3) .. ( 1/3, -1)
          .. controls ++(180:1/4) and ++( 0:1/8) .. ( 0,-9/10);
          fill [MaterialGreen500, shift=(@), rotate=-30]
          (0,0) arc (45:135:3/4 and 3/5) arc (225:315:3/4 and 3/5);
          fill [MaterialGreen700, shift=(@), rotate=-30]
          (0,0) arc (315:225:3/4 and 3/5) -- cycle;
          ,
          cherry/.pic=
          foreach i in 1,2
          tikzsetshift=(-1+i*3/4, -3/5+i/5),scale=1/2, rotate=15-i*10
          fill [MaterialRed700] (0,19/20)
          .. controls ++(180:1/8) and ++( 0:1/4) .. (-1/3, 1)
          .. controls ++(180:1/3) and ++( 90:1/2) .. ( -1, 0)
          .. controls ++(270:1/2) and ++(180:1/2) .. ( 0, -1)
          .. controls ++( 0:1/2) and ++(270:1/2) .. ( 1, 0)
          .. controls ++( 90:1/2) and ++( 0:1/3) .. ( 1/3, 1)
          .. controls ++(180:1/4) and ++( 0:1/8) .. cycle;
          fill [MaterialRed800] (0, -1)
          .. controls ++( 0:1/2) and ++(270:1/2) .. ( 1, 0)
          .. controls ++( 90:1/2) and ++( 0:1/3) .. ( 1/3, 1)
          .. controls ++(180:1/4) and ++( 0:1/8) .. ( 0,19/20) -- cycle;
          fill [MaterialRed900] (0,3/4) coordinate (@i)
          ellipse [x radius=1/4, y radius=1/8];

          fill [MaterialBrown]
          (1/4,11/8) -- (3/8,11/8) coordinate (@)
          .. controls ++(270:1/2) and ++(135:1/3) .. (@1)
          .. controls ++(135:1/2) and ++(270:1/2) .. cycle;
          fill [MaterialBrown]
          (1/4,11/8) -- (3/8,11/8)
          .. controls ++(315:1/2) and ++(45:1/2) .. (@2)
          .. controls ++(60:1/2) and ++(315:1/2) .. cycle;
          fill [MaterialGreen500, shift=(@), rotate=20]
          (0,0) arc (45:135:3/4 and 3/5) arc (225:315:3/4 and 3/5);
          fill [MaterialGreen700, shift=(@), rotate=20]
          (0,0) arc (315:225:3/4 and 3/5) -- cycle;


          newcountnframes
          nframes=80

          begindocument

          foreach n in 0,...,nframes

          begintikzpicture
          pgfmathsetmacrox10.0 * n / nframes
          pgfmathsetmacroangle5 + 25 * abs(sin(3 * 360 * (n / nframes)))
          clip (-1, -1.2) rectangle (10, 1.2);

          % food
          beginscope
          clip (x, -1.2) rectangle (10, 1.2);
          foreach i in 0,...,10

          ifnumi=5 path (8, 0) pic[scale = 0.4] apple;
          else ifnumi=8 path (5, 0) pic[scale = 0.4] cherry;
          else fill[gray, opacity = 0.3] (i, 0) circle (0.2);
          fi fi

          endscope


          % pacman
          beginscope[xshift = x cm]
          draw[thick,fill = yellow]
          (0,0) -- ++ (angle:1cm) arc (angle:360-angle:1cm) -- cycle;
          fill (0,0.66) circle (1.5mm);
          endscope

          endtikzpicture

          enddocument


          enter image description here




          EDIT: Thanks to @UlrikeFischer for the suggestion :)



          enter image description here



          newcommandinterrupted%

          pgfmathsetmacrodx11.0 / 7.0
          foreach i/c in 0/gray,1/yellow,2/cyan,3/green,4/magenta,5/red,6/blue
          fill[c] (i * dx - 1, -0.4) rectangle (i * dx + dx - 1, 1.2);

          foreach i/c in 0/blue,1/black,2/magenta,3/black,4/cyan,5/black,6/white
          fill[c] (i * dx - 1, -0.6) rectangle (i * dx + dx - 1, -0.4);


          pgfmathsetmacrodx11.0 / 6.0
          foreach i/c in 0/blue!40!black,1/white,2/blue,3/black,4/black!80,5/black
          fill[c] (i * dx - 1, -1.2) rectangle (i * dx + dx - 1, -0.6);

          node[white] at (5.5, 0) textbfNo ducks were harmed in this test



          And add this to the main loop



          pgfmathsetmacroswitchlx > 4.0
          pgfmathsetmacroswitchrx < 6.0
          ifnumswitchl=1 ifnumswitchr=1
          interrupted;
          fifi





          share|improve this answer




















          • 7





            Nice. Next step : integrate script version in a way that we can play Packman in PDF ;)

            – Kpym
            Apr 28 '18 at 9:54






          • 5





            I was worried for a minute!

            – Paulo Cereda
            Apr 28 '18 at 11:15






          • 3





            You should prove that the duck was not harmed. It could reappear after the pacman ;-)

            – Ulrike Fischer
            Apr 28 '18 at 11:27






          • 1





            A very cool animation!

            – Dr. Manuel Kuehner
            Apr 28 '18 at 13:04






          • 5





            Great answer! I created a version with reverted roles: i.stack.imgur.com/gImlU.gif

            – user36296
            Apr 28 '18 at 13:58













          39












          39








          39







          documentclass[border = 5pt, tikz]standalone

          usepackagexcolor-material

          % from https://tex.stackexchange.com/questions/413389/how-to-make-a-simple-drawing-of-an-apple-using-only-the-tikz-library
          usetikzlibraryfit
          tikzset%
          apple/.pic=
          fill [MaterialBrown] (-1/8,0)
          arc (180:120:1 and 3/2) coordinate [pos=3/5] (@)-- ++(1/6,-1/7)
          arc (120:180:5/4 and 3/2) -- cycle;
          fill [MaterialLightGreen500] (0,-9/10)
          .. controls ++(180:1/8) and ++( 0:1/4) .. (-1/3, -1)
          .. controls ++(180:1/3) and ++(270:1/2) .. ( -1, 0)
          .. controls ++( 90:1/3) and ++(180:1/3) .. (-1/2, 3/4)
          .. controls ++( 0:1/8) and ++(135:1/8) .. ( 0, 4/7)
          .. controls ++( 45:1/8) and ++(180:1/8) .. ( 1/2, 3/4)
          .. controls ++( 0:1/3) and ++( 90:1/3) .. ( 1, 0)
          .. controls ++(270:1/2) and ++( 0:1/3) .. ( 1/3, -1)
          .. controls ++(180:1/4) and ++( 0:1/8) .. cycle;
          fill [MaterialLightGreen600] (0, 4/7)
          .. controls ++( 45:1/8) and ++(180:1/8) .. ( 1/2, 3/4)
          .. controls ++( 0:1/3) and ++( 90:1/3) .. ( 1, 0)
          .. controls ++(270:1/2) and ++( 0:1/3) .. ( 1/3, -1)
          .. controls ++(180:1/4) and ++( 0:1/8) .. ( 0,-9/10);
          fill [MaterialGreen500, shift=(@), rotate=-30]
          (0,0) arc (45:135:3/4 and 3/5) arc (225:315:3/4 and 3/5);
          fill [MaterialGreen700, shift=(@), rotate=-30]
          (0,0) arc (315:225:3/4 and 3/5) -- cycle;
          ,
          cherry/.pic=
          foreach i in 1,2
          tikzsetshift=(-1+i*3/4, -3/5+i/5),scale=1/2, rotate=15-i*10
          fill [MaterialRed700] (0,19/20)
          .. controls ++(180:1/8) and ++( 0:1/4) .. (-1/3, 1)
          .. controls ++(180:1/3) and ++( 90:1/2) .. ( -1, 0)
          .. controls ++(270:1/2) and ++(180:1/2) .. ( 0, -1)
          .. controls ++( 0:1/2) and ++(270:1/2) .. ( 1, 0)
          .. controls ++( 90:1/2) and ++( 0:1/3) .. ( 1/3, 1)
          .. controls ++(180:1/4) and ++( 0:1/8) .. cycle;
          fill [MaterialRed800] (0, -1)
          .. controls ++( 0:1/2) and ++(270:1/2) .. ( 1, 0)
          .. controls ++( 90:1/2) and ++( 0:1/3) .. ( 1/3, 1)
          .. controls ++(180:1/4) and ++( 0:1/8) .. ( 0,19/20) -- cycle;
          fill [MaterialRed900] (0,3/4) coordinate (@i)
          ellipse [x radius=1/4, y radius=1/8];

          fill [MaterialBrown]
          (1/4,11/8) -- (3/8,11/8) coordinate (@)
          .. controls ++(270:1/2) and ++(135:1/3) .. (@1)
          .. controls ++(135:1/2) and ++(270:1/2) .. cycle;
          fill [MaterialBrown]
          (1/4,11/8) -- (3/8,11/8)
          .. controls ++(315:1/2) and ++(45:1/2) .. (@2)
          .. controls ++(60:1/2) and ++(315:1/2) .. cycle;
          fill [MaterialGreen500, shift=(@), rotate=20]
          (0,0) arc (45:135:3/4 and 3/5) arc (225:315:3/4 and 3/5);
          fill [MaterialGreen700, shift=(@), rotate=20]
          (0,0) arc (315:225:3/4 and 3/5) -- cycle;


          newcountnframes
          nframes=80

          begindocument

          foreach n in 0,...,nframes

          begintikzpicture
          pgfmathsetmacrox10.0 * n / nframes
          pgfmathsetmacroangle5 + 25 * abs(sin(3 * 360 * (n / nframes)))
          clip (-1, -1.2) rectangle (10, 1.2);

          % food
          beginscope
          clip (x, -1.2) rectangle (10, 1.2);
          foreach i in 0,...,10

          ifnumi=5 path (8, 0) pic[scale = 0.4] apple;
          else ifnumi=8 path (5, 0) pic[scale = 0.4] cherry;
          else fill[gray, opacity = 0.3] (i, 0) circle (0.2);
          fi fi

          endscope


          % pacman
          beginscope[xshift = x cm]
          draw[thick,fill = yellow]
          (0,0) -- ++ (angle:1cm) arc (angle:360-angle:1cm) -- cycle;
          fill (0,0.66) circle (1.5mm);
          endscope

          endtikzpicture

          enddocument


          enter image description here




          EDIT: Thanks to @UlrikeFischer for the suggestion :)



          enter image description here



          newcommandinterrupted%

          pgfmathsetmacrodx11.0 / 7.0
          foreach i/c in 0/gray,1/yellow,2/cyan,3/green,4/magenta,5/red,6/blue
          fill[c] (i * dx - 1, -0.4) rectangle (i * dx + dx - 1, 1.2);

          foreach i/c in 0/blue,1/black,2/magenta,3/black,4/cyan,5/black,6/white
          fill[c] (i * dx - 1, -0.6) rectangle (i * dx + dx - 1, -0.4);


          pgfmathsetmacrodx11.0 / 6.0
          foreach i/c in 0/blue!40!black,1/white,2/blue,3/black,4/black!80,5/black
          fill[c] (i * dx - 1, -1.2) rectangle (i * dx + dx - 1, -0.6);

          node[white] at (5.5, 0) textbfNo ducks were harmed in this test



          And add this to the main loop



          pgfmathsetmacroswitchlx > 4.0
          pgfmathsetmacroswitchrx < 6.0
          ifnumswitchl=1 ifnumswitchr=1
          interrupted;
          fifi





          share|improve this answer















          documentclass[border = 5pt, tikz]standalone

          usepackagexcolor-material

          % from https://tex.stackexchange.com/questions/413389/how-to-make-a-simple-drawing-of-an-apple-using-only-the-tikz-library
          usetikzlibraryfit
          tikzset%
          apple/.pic=
          fill [MaterialBrown] (-1/8,0)
          arc (180:120:1 and 3/2) coordinate [pos=3/5] (@)-- ++(1/6,-1/7)
          arc (120:180:5/4 and 3/2) -- cycle;
          fill [MaterialLightGreen500] (0,-9/10)
          .. controls ++(180:1/8) and ++( 0:1/4) .. (-1/3, -1)
          .. controls ++(180:1/3) and ++(270:1/2) .. ( -1, 0)
          .. controls ++( 90:1/3) and ++(180:1/3) .. (-1/2, 3/4)
          .. controls ++( 0:1/8) and ++(135:1/8) .. ( 0, 4/7)
          .. controls ++( 45:1/8) and ++(180:1/8) .. ( 1/2, 3/4)
          .. controls ++( 0:1/3) and ++( 90:1/3) .. ( 1, 0)
          .. controls ++(270:1/2) and ++( 0:1/3) .. ( 1/3, -1)
          .. controls ++(180:1/4) and ++( 0:1/8) .. cycle;
          fill [MaterialLightGreen600] (0, 4/7)
          .. controls ++( 45:1/8) and ++(180:1/8) .. ( 1/2, 3/4)
          .. controls ++( 0:1/3) and ++( 90:1/3) .. ( 1, 0)
          .. controls ++(270:1/2) and ++( 0:1/3) .. ( 1/3, -1)
          .. controls ++(180:1/4) and ++( 0:1/8) .. ( 0,-9/10);
          fill [MaterialGreen500, shift=(@), rotate=-30]
          (0,0) arc (45:135:3/4 and 3/5) arc (225:315:3/4 and 3/5);
          fill [MaterialGreen700, shift=(@), rotate=-30]
          (0,0) arc (315:225:3/4 and 3/5) -- cycle;
          ,
          cherry/.pic=
          foreach i in 1,2
          tikzsetshift=(-1+i*3/4, -3/5+i/5),scale=1/2, rotate=15-i*10
          fill [MaterialRed700] (0,19/20)
          .. controls ++(180:1/8) and ++( 0:1/4) .. (-1/3, 1)
          .. controls ++(180:1/3) and ++( 90:1/2) .. ( -1, 0)
          .. controls ++(270:1/2) and ++(180:1/2) .. ( 0, -1)
          .. controls ++( 0:1/2) and ++(270:1/2) .. ( 1, 0)
          .. controls ++( 90:1/2) and ++( 0:1/3) .. ( 1/3, 1)
          .. controls ++(180:1/4) and ++( 0:1/8) .. cycle;
          fill [MaterialRed800] (0, -1)
          .. controls ++( 0:1/2) and ++(270:1/2) .. ( 1, 0)
          .. controls ++( 90:1/2) and ++( 0:1/3) .. ( 1/3, 1)
          .. controls ++(180:1/4) and ++( 0:1/8) .. ( 0,19/20) -- cycle;
          fill [MaterialRed900] (0,3/4) coordinate (@i)
          ellipse [x radius=1/4, y radius=1/8];

          fill [MaterialBrown]
          (1/4,11/8) -- (3/8,11/8) coordinate (@)
          .. controls ++(270:1/2) and ++(135:1/3) .. (@1)
          .. controls ++(135:1/2) and ++(270:1/2) .. cycle;
          fill [MaterialBrown]
          (1/4,11/8) -- (3/8,11/8)
          .. controls ++(315:1/2) and ++(45:1/2) .. (@2)
          .. controls ++(60:1/2) and ++(315:1/2) .. cycle;
          fill [MaterialGreen500, shift=(@), rotate=20]
          (0,0) arc (45:135:3/4 and 3/5) arc (225:315:3/4 and 3/5);
          fill [MaterialGreen700, shift=(@), rotate=20]
          (0,0) arc (315:225:3/4 and 3/5) -- cycle;


          newcountnframes
          nframes=80

          begindocument

          foreach n in 0,...,nframes

          begintikzpicture
          pgfmathsetmacrox10.0 * n / nframes
          pgfmathsetmacroangle5 + 25 * abs(sin(3 * 360 * (n / nframes)))
          clip (-1, -1.2) rectangle (10, 1.2);

          % food
          beginscope
          clip (x, -1.2) rectangle (10, 1.2);
          foreach i in 0,...,10

          ifnumi=5 path (8, 0) pic[scale = 0.4] apple;
          else ifnumi=8 path (5, 0) pic[scale = 0.4] cherry;
          else fill[gray, opacity = 0.3] (i, 0) circle (0.2);
          fi fi

          endscope


          % pacman
          beginscope[xshift = x cm]
          draw[thick,fill = yellow]
          (0,0) -- ++ (angle:1cm) arc (angle:360-angle:1cm) -- cycle;
          fill (0,0.66) circle (1.5mm);
          endscope

          endtikzpicture

          enddocument


          enter image description here




          EDIT: Thanks to @UlrikeFischer for the suggestion :)



          enter image description here



          newcommandinterrupted%

          pgfmathsetmacrodx11.0 / 7.0
          foreach i/c in 0/gray,1/yellow,2/cyan,3/green,4/magenta,5/red,6/blue
          fill[c] (i * dx - 1, -0.4) rectangle (i * dx + dx - 1, 1.2);

          foreach i/c in 0/blue,1/black,2/magenta,3/black,4/cyan,5/black,6/white
          fill[c] (i * dx - 1, -0.6) rectangle (i * dx + dx - 1, -0.4);


          pgfmathsetmacrodx11.0 / 6.0
          foreach i/c in 0/blue!40!black,1/white,2/blue,3/black,4/black!80,5/black
          fill[c] (i * dx - 1, -1.2) rectangle (i * dx + dx - 1, -0.6);

          node[white] at (5.5, 0) textbfNo ducks were harmed in this test



          And add this to the main loop



          pgfmathsetmacroswitchlx > 4.0
          pgfmathsetmacroswitchrx < 6.0
          ifnumswitchl=1 ifnumswitchr=1
          interrupted;
          fifi






          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Apr 28 '18 at 11:07

























          answered Apr 28 '18 at 9:46









          caveraccaverac

          6,6771827




          6,6771827







          • 7





            Nice. Next step : integrate script version in a way that we can play Packman in PDF ;)

            – Kpym
            Apr 28 '18 at 9:54






          • 5





            I was worried for a minute!

            – Paulo Cereda
            Apr 28 '18 at 11:15






          • 3





            You should prove that the duck was not harmed. It could reappear after the pacman ;-)

            – Ulrike Fischer
            Apr 28 '18 at 11:27






          • 1





            A very cool animation!

            – Dr. Manuel Kuehner
            Apr 28 '18 at 13:04






          • 5





            Great answer! I created a version with reverted roles: i.stack.imgur.com/gImlU.gif

            – user36296
            Apr 28 '18 at 13:58












          • 7





            Nice. Next step : integrate script version in a way that we can play Packman in PDF ;)

            – Kpym
            Apr 28 '18 at 9:54






          • 5





            I was worried for a minute!

            – Paulo Cereda
            Apr 28 '18 at 11:15






          • 3





            You should prove that the duck was not harmed. It could reappear after the pacman ;-)

            – Ulrike Fischer
            Apr 28 '18 at 11:27






          • 1





            A very cool animation!

            – Dr. Manuel Kuehner
            Apr 28 '18 at 13:04






          • 5





            Great answer! I created a version with reverted roles: i.stack.imgur.com/gImlU.gif

            – user36296
            Apr 28 '18 at 13:58







          7




          7





          Nice. Next step : integrate script version in a way that we can play Packman in PDF ;)

          – Kpym
          Apr 28 '18 at 9:54





          Nice. Next step : integrate script version in a way that we can play Packman in PDF ;)

          – Kpym
          Apr 28 '18 at 9:54




          5




          5





          I was worried for a minute!

          – Paulo Cereda
          Apr 28 '18 at 11:15





          I was worried for a minute!

          – Paulo Cereda
          Apr 28 '18 at 11:15




          3




          3





          You should prove that the duck was not harmed. It could reappear after the pacman ;-)

          – Ulrike Fischer
          Apr 28 '18 at 11:27





          You should prove that the duck was not harmed. It could reappear after the pacman ;-)

          – Ulrike Fischer
          Apr 28 '18 at 11:27




          1




          1





          A very cool animation!

          – Dr. Manuel Kuehner
          Apr 28 '18 at 13:04





          A very cool animation!

          – Dr. Manuel Kuehner
          Apr 28 '18 at 13:04




          5




          5





          Great answer! I created a version with reverted roles: i.stack.imgur.com/gImlU.gif

          – user36296
          Apr 28 '18 at 13:58





          Great answer! I created a version with reverted roles: i.stack.imgur.com/gImlU.gif

          – user36296
          Apr 28 '18 at 13:58











          39














          I think you misinterpret what the in and out syntax does. You may want to use arc.



          documentclass[tikz,border=3.14mm]standalone
          tikzset
          Pacman/.pic=
          shadedraw[inner color=yellow,outer color=yellow!80!black,draw=black,thick]
          (0,0) -- (40:2) arc(40:320:2) -- cycle;
          fill (0,1) circle (0.3);



          begindocument
          begintikzpicture
          pic Pacman;
          pic[xscale=-1] at (5,0) Pacman;
          endtikzpicture
          enddocument


          enter image description here



          Anyway, here is a 3D version.



          documentclass[tikz,border=3.14mm]standalone
          tikzsetPacman/.pic=
          fill (0,0) to[out=1.75*#1,in=180-0.25*#1] (0.92*#1:2)
          to[out=-180+0.25*#1,in=1.75*#1,looseness=0.5] (1,0)
          to[out=-1.75*#1,in=180-0.25*#1,looseness=0.5] (-0.92*#1:2)
          to [out=-180+0.25*#1,in=-1.75*#1] cycle;
          shadedraw[ball color=yellow,thick]
          (0,0) to[out=1.75*#1,in=180-0.25*#1] (0.92*#1:2)
          arc(0.92*#1:360-0.92*#1:2) to [out=-180+0.25*#1,in=-1.75*#1]
          cycle;
          fill (0.3-0.01*#1,1) circle (0.3);



          begindocument
          begintikzpicture
          pic Pacman=50;
          pic[xscale=-1] at (5,0) Pacman=20;
          endtikzpicture
          enddocument


          enter image description here



          EDIT: Added backwards facing Pacman and used pic and added 3D.



          2nd EDIT: Inspired by samcarter, who got inspired by caverac: a 3D animation using this answer.



          documentclassarticle

          usepackageanimate

          %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
          usepackage[active,tightpage]preview
          makeatletter
          def@anim@@newframe@ifstar@anim@newframe@anim@newframe
          def@anim@newframeendpreviewbeginpreview
          renewenvironmentanimateinline[2][]%
          letnewframe@anim@@newframe%
          letmultiframe@anim@multiframe%
          beginpreview%
          endpreview
          makeatother
          %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
          usepackagetikz
          usepgfmodulenonlineartransformations
          usetikzlibraryshapes
          usetikzlibrarypatterns
          makeatletter
          % from https://tex.stackexchange.com/q/56353/121799
          newcommandgettikzxy[3]%
          tikz@scan@one@pointpgfutil@firstofone#1relax
          globaledef#2thepgf@x%
          globaledef#3thepgf@y%

          % from the manual section 103.4.2
          % pgf@x will contain the xoutradius angle
          % pgf@y will contain the distance pgfmathsincos@pgf@sys@tonumberpgf@x%
          % pgfmathresultx is now the cosine of xoutradius radius and
          % pgfmathresulty is the sine of radius
          % pgf@x=pgfmathresultxpgf@y%
          % pgf@y=pgfmathresultypgf@y%
          % what the thing in the pgf manually is probably doing it to express the x coordinate in pt
          % then take the cos and sin of x/pt (i.e. if x=50pt then it will return cos(50))
          % and multiply the outcome by a the y coordinate
          % (x_new,y_new) = (y_old cos(x_old/pt), y_old sin(x_old/pt))
          % now comes a slightly modified version
          defmarmotransformation% modified version of the manual 103.4.2 Installing Nonlinear Transformation
          advancepgf@x by -xC% relative
          advancepgf@y by -yC% coorinates
          edefrelXthepgf@x%
          edefrelYthepgf@y% Yes, there is a more elegant solution based on pgfpointadd
          pgfmathsetmacrorelNxxN-xC%
          pgfmathsetmacrorelNyyN-yC%
          pgfmathsetmacroangleNatan2(relNy,relNx)%
          pgfmathsetmacroLeNveclen(relNx,relNy)%
          pgfmathsetmacromyp(relX*relNx+relY*relNy)/(LeN*28.3465)
          pgfmathsetmacromyo(((relY*relNx-relX*relNy))/(myp*LeN*(28.3465*pi/180)))+angleN)
          pgfpointaddpgfqpointxCyCpgfpointpolarxymyomyp



          begindocument
          beginanimateinline[autoplay,loop]2
          multiframe21i=0+1pgfmathsetmacromyangle60-5*abs(i-10)
          begintikzpicture[ball color=red]
          %pic[scale=2] at (-6.5,0) Pacman=myangle;
          beginscope[xshift=-(6.5-0.4*i)*1cm,scale=2]
          fill (0,0) to[out=1.75*myangle,in=180-0.25*myangle] (0.92*myangle:2)
          to[out=-180+0.25*myangle,in=1.75*myangle,looseness=0.5] (1,0)
          to[out=-1.75*myangle,in=180-0.25*myangle,looseness=0.5]
          (-0.92*myangle:2) to [out=-180+0.25*myangle,in=-1.75*myangle] cycle;
          endscope
          %
          coordinate (C) at (0,3) ;
          gettikzxy(C)xCyC
          coordinate (N) at (0,0) ;
          gettikzxy(N)xNyN
          beginscope[transform shape nonlinear=true]
          pgftransformnonlinearmarmotransformation
          shade[shading=ball,opacity=1] (0,0) circle (2);
          endscope
          draw[smooth,fill=black](-0.15,3) .. controls (-0.15,2.5) .. (0,2) to
          (0.1,2) .. controls (-0.05,2.5) .. (-0.05,3) --cycle;
          %
          beginscope[xshift=-(6.5-0.4*i)*1cm,scale=2]
          shadedraw[ball color=yellow,thick]
          (0,0) to[out=1.75*myangle,in=180-0.25*myangle] (0.92*myangle:2)
          arc(0.92*myangle:360-0.92*myangle:2) to [out=-180+0.25*myangle,in=-1.75*myangle]
          cycle;
          fill (0.3-0.01*myangle,1) circle (0.3);
          endscope
          path[use as bounding box](-8,-2) rectangle 4,2);
          endtikzpicture

          endanimateinline
          enddocument


          enter image description here






          share|improve this answer

























          • Thanks! I also want to draw a Pacman that faces the opposite direction. I tried both 140:220 and 220:140, but neither works. What should I do?

            – user11550
            Apr 28 '18 at 5:38






          • 1





            @user11550 (0,0) -- (140:2) arc(140:-140:2) -- cycle;

            – Ignasi
            Apr 28 '18 at 7:47











          • @user11550 I added a Pacman facing in opposite direction.

            – marmot
            Apr 28 '18 at 11:09






          • 2





            This looks like it belongs on the fishing channel!

            – Steven B. Segletes
            Apr 30 '18 at 10:29











          • @StevenB.Segletes Done.

            – marmot
            Jul 31 '18 at 23:05















          39














          I think you misinterpret what the in and out syntax does. You may want to use arc.



          documentclass[tikz,border=3.14mm]standalone
          tikzset
          Pacman/.pic=
          shadedraw[inner color=yellow,outer color=yellow!80!black,draw=black,thick]
          (0,0) -- (40:2) arc(40:320:2) -- cycle;
          fill (0,1) circle (0.3);



          begindocument
          begintikzpicture
          pic Pacman;
          pic[xscale=-1] at (5,0) Pacman;
          endtikzpicture
          enddocument


          enter image description here



          Anyway, here is a 3D version.



          documentclass[tikz,border=3.14mm]standalone
          tikzsetPacman/.pic=
          fill (0,0) to[out=1.75*#1,in=180-0.25*#1] (0.92*#1:2)
          to[out=-180+0.25*#1,in=1.75*#1,looseness=0.5] (1,0)
          to[out=-1.75*#1,in=180-0.25*#1,looseness=0.5] (-0.92*#1:2)
          to [out=-180+0.25*#1,in=-1.75*#1] cycle;
          shadedraw[ball color=yellow,thick]
          (0,0) to[out=1.75*#1,in=180-0.25*#1] (0.92*#1:2)
          arc(0.92*#1:360-0.92*#1:2) to [out=-180+0.25*#1,in=-1.75*#1]
          cycle;
          fill (0.3-0.01*#1,1) circle (0.3);



          begindocument
          begintikzpicture
          pic Pacman=50;
          pic[xscale=-1] at (5,0) Pacman=20;
          endtikzpicture
          enddocument


          enter image description here



          EDIT: Added backwards facing Pacman and used pic and added 3D.



          2nd EDIT: Inspired by samcarter, who got inspired by caverac: a 3D animation using this answer.



          documentclassarticle

          usepackageanimate

          %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
          usepackage[active,tightpage]preview
          makeatletter
          def@anim@@newframe@ifstar@anim@newframe@anim@newframe
          def@anim@newframeendpreviewbeginpreview
          renewenvironmentanimateinline[2][]%
          letnewframe@anim@@newframe%
          letmultiframe@anim@multiframe%
          beginpreview%
          endpreview
          makeatother
          %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
          usepackagetikz
          usepgfmodulenonlineartransformations
          usetikzlibraryshapes
          usetikzlibrarypatterns
          makeatletter
          % from https://tex.stackexchange.com/q/56353/121799
          newcommandgettikzxy[3]%
          tikz@scan@one@pointpgfutil@firstofone#1relax
          globaledef#2thepgf@x%
          globaledef#3thepgf@y%

          % from the manual section 103.4.2
          % pgf@x will contain the xoutradius angle
          % pgf@y will contain the distance pgfmathsincos@pgf@sys@tonumberpgf@x%
          % pgfmathresultx is now the cosine of xoutradius radius and
          % pgfmathresulty is the sine of radius
          % pgf@x=pgfmathresultxpgf@y%
          % pgf@y=pgfmathresultypgf@y%
          % what the thing in the pgf manually is probably doing it to express the x coordinate in pt
          % then take the cos and sin of x/pt (i.e. if x=50pt then it will return cos(50))
          % and multiply the outcome by a the y coordinate
          % (x_new,y_new) = (y_old cos(x_old/pt), y_old sin(x_old/pt))
          % now comes a slightly modified version
          defmarmotransformation% modified version of the manual 103.4.2 Installing Nonlinear Transformation
          advancepgf@x by -xC% relative
          advancepgf@y by -yC% coorinates
          edefrelXthepgf@x%
          edefrelYthepgf@y% Yes, there is a more elegant solution based on pgfpointadd
          pgfmathsetmacrorelNxxN-xC%
          pgfmathsetmacrorelNyyN-yC%
          pgfmathsetmacroangleNatan2(relNy,relNx)%
          pgfmathsetmacroLeNveclen(relNx,relNy)%
          pgfmathsetmacromyp(relX*relNx+relY*relNy)/(LeN*28.3465)
          pgfmathsetmacromyo(((relY*relNx-relX*relNy))/(myp*LeN*(28.3465*pi/180)))+angleN)
          pgfpointaddpgfqpointxCyCpgfpointpolarxymyomyp



          begindocument
          beginanimateinline[autoplay,loop]2
          multiframe21i=0+1pgfmathsetmacromyangle60-5*abs(i-10)
          begintikzpicture[ball color=red]
          %pic[scale=2] at (-6.5,0) Pacman=myangle;
          beginscope[xshift=-(6.5-0.4*i)*1cm,scale=2]
          fill (0,0) to[out=1.75*myangle,in=180-0.25*myangle] (0.92*myangle:2)
          to[out=-180+0.25*myangle,in=1.75*myangle,looseness=0.5] (1,0)
          to[out=-1.75*myangle,in=180-0.25*myangle,looseness=0.5]
          (-0.92*myangle:2) to [out=-180+0.25*myangle,in=-1.75*myangle] cycle;
          endscope
          %
          coordinate (C) at (0,3) ;
          gettikzxy(C)xCyC
          coordinate (N) at (0,0) ;
          gettikzxy(N)xNyN
          beginscope[transform shape nonlinear=true]
          pgftransformnonlinearmarmotransformation
          shade[shading=ball,opacity=1] (0,0) circle (2);
          endscope
          draw[smooth,fill=black](-0.15,3) .. controls (-0.15,2.5) .. (0,2) to
          (0.1,2) .. controls (-0.05,2.5) .. (-0.05,3) --cycle;
          %
          beginscope[xshift=-(6.5-0.4*i)*1cm,scale=2]
          shadedraw[ball color=yellow,thick]
          (0,0) to[out=1.75*myangle,in=180-0.25*myangle] (0.92*myangle:2)
          arc(0.92*myangle:360-0.92*myangle:2) to [out=-180+0.25*myangle,in=-1.75*myangle]
          cycle;
          fill (0.3-0.01*myangle,1) circle (0.3);
          endscope
          path[use as bounding box](-8,-2) rectangle 4,2);
          endtikzpicture

          endanimateinline
          enddocument


          enter image description here






          share|improve this answer

























          • Thanks! I also want to draw a Pacman that faces the opposite direction. I tried both 140:220 and 220:140, but neither works. What should I do?

            – user11550
            Apr 28 '18 at 5:38






          • 1





            @user11550 (0,0) -- (140:2) arc(140:-140:2) -- cycle;

            – Ignasi
            Apr 28 '18 at 7:47











          • @user11550 I added a Pacman facing in opposite direction.

            – marmot
            Apr 28 '18 at 11:09






          • 2





            This looks like it belongs on the fishing channel!

            – Steven B. Segletes
            Apr 30 '18 at 10:29











          • @StevenB.Segletes Done.

            – marmot
            Jul 31 '18 at 23:05













          39












          39








          39







          I think you misinterpret what the in and out syntax does. You may want to use arc.



          documentclass[tikz,border=3.14mm]standalone
          tikzset
          Pacman/.pic=
          shadedraw[inner color=yellow,outer color=yellow!80!black,draw=black,thick]
          (0,0) -- (40:2) arc(40:320:2) -- cycle;
          fill (0,1) circle (0.3);



          begindocument
          begintikzpicture
          pic Pacman;
          pic[xscale=-1] at (5,0) Pacman;
          endtikzpicture
          enddocument


          enter image description here



          Anyway, here is a 3D version.



          documentclass[tikz,border=3.14mm]standalone
          tikzsetPacman/.pic=
          fill (0,0) to[out=1.75*#1,in=180-0.25*#1] (0.92*#1:2)
          to[out=-180+0.25*#1,in=1.75*#1,looseness=0.5] (1,0)
          to[out=-1.75*#1,in=180-0.25*#1,looseness=0.5] (-0.92*#1:2)
          to [out=-180+0.25*#1,in=-1.75*#1] cycle;
          shadedraw[ball color=yellow,thick]
          (0,0) to[out=1.75*#1,in=180-0.25*#1] (0.92*#1:2)
          arc(0.92*#1:360-0.92*#1:2) to [out=-180+0.25*#1,in=-1.75*#1]
          cycle;
          fill (0.3-0.01*#1,1) circle (0.3);



          begindocument
          begintikzpicture
          pic Pacman=50;
          pic[xscale=-1] at (5,0) Pacman=20;
          endtikzpicture
          enddocument


          enter image description here



          EDIT: Added backwards facing Pacman and used pic and added 3D.



          2nd EDIT: Inspired by samcarter, who got inspired by caverac: a 3D animation using this answer.



          documentclassarticle

          usepackageanimate

          %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
          usepackage[active,tightpage]preview
          makeatletter
          def@anim@@newframe@ifstar@anim@newframe@anim@newframe
          def@anim@newframeendpreviewbeginpreview
          renewenvironmentanimateinline[2][]%
          letnewframe@anim@@newframe%
          letmultiframe@anim@multiframe%
          beginpreview%
          endpreview
          makeatother
          %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
          usepackagetikz
          usepgfmodulenonlineartransformations
          usetikzlibraryshapes
          usetikzlibrarypatterns
          makeatletter
          % from https://tex.stackexchange.com/q/56353/121799
          newcommandgettikzxy[3]%
          tikz@scan@one@pointpgfutil@firstofone#1relax
          globaledef#2thepgf@x%
          globaledef#3thepgf@y%

          % from the manual section 103.4.2
          % pgf@x will contain the xoutradius angle
          % pgf@y will contain the distance pgfmathsincos@pgf@sys@tonumberpgf@x%
          % pgfmathresultx is now the cosine of xoutradius radius and
          % pgfmathresulty is the sine of radius
          % pgf@x=pgfmathresultxpgf@y%
          % pgf@y=pgfmathresultypgf@y%
          % what the thing in the pgf manually is probably doing it to express the x coordinate in pt
          % then take the cos and sin of x/pt (i.e. if x=50pt then it will return cos(50))
          % and multiply the outcome by a the y coordinate
          % (x_new,y_new) = (y_old cos(x_old/pt), y_old sin(x_old/pt))
          % now comes a slightly modified version
          defmarmotransformation% modified version of the manual 103.4.2 Installing Nonlinear Transformation
          advancepgf@x by -xC% relative
          advancepgf@y by -yC% coorinates
          edefrelXthepgf@x%
          edefrelYthepgf@y% Yes, there is a more elegant solution based on pgfpointadd
          pgfmathsetmacrorelNxxN-xC%
          pgfmathsetmacrorelNyyN-yC%
          pgfmathsetmacroangleNatan2(relNy,relNx)%
          pgfmathsetmacroLeNveclen(relNx,relNy)%
          pgfmathsetmacromyp(relX*relNx+relY*relNy)/(LeN*28.3465)
          pgfmathsetmacromyo(((relY*relNx-relX*relNy))/(myp*LeN*(28.3465*pi/180)))+angleN)
          pgfpointaddpgfqpointxCyCpgfpointpolarxymyomyp



          begindocument
          beginanimateinline[autoplay,loop]2
          multiframe21i=0+1pgfmathsetmacromyangle60-5*abs(i-10)
          begintikzpicture[ball color=red]
          %pic[scale=2] at (-6.5,0) Pacman=myangle;
          beginscope[xshift=-(6.5-0.4*i)*1cm,scale=2]
          fill (0,0) to[out=1.75*myangle,in=180-0.25*myangle] (0.92*myangle:2)
          to[out=-180+0.25*myangle,in=1.75*myangle,looseness=0.5] (1,0)
          to[out=-1.75*myangle,in=180-0.25*myangle,looseness=0.5]
          (-0.92*myangle:2) to [out=-180+0.25*myangle,in=-1.75*myangle] cycle;
          endscope
          %
          coordinate (C) at (0,3) ;
          gettikzxy(C)xCyC
          coordinate (N) at (0,0) ;
          gettikzxy(N)xNyN
          beginscope[transform shape nonlinear=true]
          pgftransformnonlinearmarmotransformation
          shade[shading=ball,opacity=1] (0,0) circle (2);
          endscope
          draw[smooth,fill=black](-0.15,3) .. controls (-0.15,2.5) .. (0,2) to
          (0.1,2) .. controls (-0.05,2.5) .. (-0.05,3) --cycle;
          %
          beginscope[xshift=-(6.5-0.4*i)*1cm,scale=2]
          shadedraw[ball color=yellow,thick]
          (0,0) to[out=1.75*myangle,in=180-0.25*myangle] (0.92*myangle:2)
          arc(0.92*myangle:360-0.92*myangle:2) to [out=-180+0.25*myangle,in=-1.75*myangle]
          cycle;
          fill (0.3-0.01*myangle,1) circle (0.3);
          endscope
          path[use as bounding box](-8,-2) rectangle 4,2);
          endtikzpicture

          endanimateinline
          enddocument


          enter image description here






          share|improve this answer















          I think you misinterpret what the in and out syntax does. You may want to use arc.



          documentclass[tikz,border=3.14mm]standalone
          tikzset
          Pacman/.pic=
          shadedraw[inner color=yellow,outer color=yellow!80!black,draw=black,thick]
          (0,0) -- (40:2) arc(40:320:2) -- cycle;
          fill (0,1) circle (0.3);



          begindocument
          begintikzpicture
          pic Pacman;
          pic[xscale=-1] at (5,0) Pacman;
          endtikzpicture
          enddocument


          enter image description here



          Anyway, here is a 3D version.



          documentclass[tikz,border=3.14mm]standalone
          tikzsetPacman/.pic=
          fill (0,0) to[out=1.75*#1,in=180-0.25*#1] (0.92*#1:2)
          to[out=-180+0.25*#1,in=1.75*#1,looseness=0.5] (1,0)
          to[out=-1.75*#1,in=180-0.25*#1,looseness=0.5] (-0.92*#1:2)
          to [out=-180+0.25*#1,in=-1.75*#1] cycle;
          shadedraw[ball color=yellow,thick]
          (0,0) to[out=1.75*#1,in=180-0.25*#1] (0.92*#1:2)
          arc(0.92*#1:360-0.92*#1:2) to [out=-180+0.25*#1,in=-1.75*#1]
          cycle;
          fill (0.3-0.01*#1,1) circle (0.3);



          begindocument
          begintikzpicture
          pic Pacman=50;
          pic[xscale=-1] at (5,0) Pacman=20;
          endtikzpicture
          enddocument


          enter image description here



          EDIT: Added backwards facing Pacman and used pic and added 3D.



          2nd EDIT: Inspired by samcarter, who got inspired by caverac: a 3D animation using this answer.



          documentclassarticle

          usepackageanimate

          %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
          usepackage[active,tightpage]preview
          makeatletter
          def@anim@@newframe@ifstar@anim@newframe@anim@newframe
          def@anim@newframeendpreviewbeginpreview
          renewenvironmentanimateinline[2][]%
          letnewframe@anim@@newframe%
          letmultiframe@anim@multiframe%
          beginpreview%
          endpreview
          makeatother
          %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
          usepackagetikz
          usepgfmodulenonlineartransformations
          usetikzlibraryshapes
          usetikzlibrarypatterns
          makeatletter
          % from https://tex.stackexchange.com/q/56353/121799
          newcommandgettikzxy[3]%
          tikz@scan@one@pointpgfutil@firstofone#1relax
          globaledef#2thepgf@x%
          globaledef#3thepgf@y%

          % from the manual section 103.4.2
          % pgf@x will contain the xoutradius angle
          % pgf@y will contain the distance pgfmathsincos@pgf@sys@tonumberpgf@x%
          % pgfmathresultx is now the cosine of xoutradius radius and
          % pgfmathresulty is the sine of radius
          % pgf@x=pgfmathresultxpgf@y%
          % pgf@y=pgfmathresultypgf@y%
          % what the thing in the pgf manually is probably doing it to express the x coordinate in pt
          % then take the cos and sin of x/pt (i.e. if x=50pt then it will return cos(50))
          % and multiply the outcome by a the y coordinate
          % (x_new,y_new) = (y_old cos(x_old/pt), y_old sin(x_old/pt))
          % now comes a slightly modified version
          defmarmotransformation% modified version of the manual 103.4.2 Installing Nonlinear Transformation
          advancepgf@x by -xC% relative
          advancepgf@y by -yC% coorinates
          edefrelXthepgf@x%
          edefrelYthepgf@y% Yes, there is a more elegant solution based on pgfpointadd
          pgfmathsetmacrorelNxxN-xC%
          pgfmathsetmacrorelNyyN-yC%
          pgfmathsetmacroangleNatan2(relNy,relNx)%
          pgfmathsetmacroLeNveclen(relNx,relNy)%
          pgfmathsetmacromyp(relX*relNx+relY*relNy)/(LeN*28.3465)
          pgfmathsetmacromyo(((relY*relNx-relX*relNy))/(myp*LeN*(28.3465*pi/180)))+angleN)
          pgfpointaddpgfqpointxCyCpgfpointpolarxymyomyp



          begindocument
          beginanimateinline[autoplay,loop]2
          multiframe21i=0+1pgfmathsetmacromyangle60-5*abs(i-10)
          begintikzpicture[ball color=red]
          %pic[scale=2] at (-6.5,0) Pacman=myangle;
          beginscope[xshift=-(6.5-0.4*i)*1cm,scale=2]
          fill (0,0) to[out=1.75*myangle,in=180-0.25*myangle] (0.92*myangle:2)
          to[out=-180+0.25*myangle,in=1.75*myangle,looseness=0.5] (1,0)
          to[out=-1.75*myangle,in=180-0.25*myangle,looseness=0.5]
          (-0.92*myangle:2) to [out=-180+0.25*myangle,in=-1.75*myangle] cycle;
          endscope
          %
          coordinate (C) at (0,3) ;
          gettikzxy(C)xCyC
          coordinate (N) at (0,0) ;
          gettikzxy(N)xNyN
          beginscope[transform shape nonlinear=true]
          pgftransformnonlinearmarmotransformation
          shade[shading=ball,opacity=1] (0,0) circle (2);
          endscope
          draw[smooth,fill=black](-0.15,3) .. controls (-0.15,2.5) .. (0,2) to
          (0.1,2) .. controls (-0.05,2.5) .. (-0.05,3) --cycle;
          %
          beginscope[xshift=-(6.5-0.4*i)*1cm,scale=2]
          shadedraw[ball color=yellow,thick]
          (0,0) to[out=1.75*myangle,in=180-0.25*myangle] (0.92*myangle:2)
          arc(0.92*myangle:360-0.92*myangle:2) to [out=-180+0.25*myangle,in=-1.75*myangle]
          cycle;
          fill (0.3-0.01*myangle,1) circle (0.3);
          endscope
          path[use as bounding box](-8,-2) rectangle 4,2);
          endtikzpicture

          endanimateinline
          enddocument


          enter image description here







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Apr 29 '18 at 16:58

























          answered Apr 28 '18 at 3:55









          marmotmarmot

          117k5150283




          117k5150283












          • Thanks! I also want to draw a Pacman that faces the opposite direction. I tried both 140:220 and 220:140, but neither works. What should I do?

            – user11550
            Apr 28 '18 at 5:38






          • 1





            @user11550 (0,0) -- (140:2) arc(140:-140:2) -- cycle;

            – Ignasi
            Apr 28 '18 at 7:47











          • @user11550 I added a Pacman facing in opposite direction.

            – marmot
            Apr 28 '18 at 11:09






          • 2





            This looks like it belongs on the fishing channel!

            – Steven B. Segletes
            Apr 30 '18 at 10:29











          • @StevenB.Segletes Done.

            – marmot
            Jul 31 '18 at 23:05

















          • Thanks! I also want to draw a Pacman that faces the opposite direction. I tried both 140:220 and 220:140, but neither works. What should I do?

            – user11550
            Apr 28 '18 at 5:38






          • 1





            @user11550 (0,0) -- (140:2) arc(140:-140:2) -- cycle;

            – Ignasi
            Apr 28 '18 at 7:47











          • @user11550 I added a Pacman facing in opposite direction.

            – marmot
            Apr 28 '18 at 11:09






          • 2





            This looks like it belongs on the fishing channel!

            – Steven B. Segletes
            Apr 30 '18 at 10:29











          • @StevenB.Segletes Done.

            – marmot
            Jul 31 '18 at 23:05
















          Thanks! I also want to draw a Pacman that faces the opposite direction. I tried both 140:220 and 220:140, but neither works. What should I do?

          – user11550
          Apr 28 '18 at 5:38





          Thanks! I also want to draw a Pacman that faces the opposite direction. I tried both 140:220 and 220:140, but neither works. What should I do?

          – user11550
          Apr 28 '18 at 5:38




          1




          1





          @user11550 (0,0) -- (140:2) arc(140:-140:2) -- cycle;

          – Ignasi
          Apr 28 '18 at 7:47





          @user11550 (0,0) -- (140:2) arc(140:-140:2) -- cycle;

          – Ignasi
          Apr 28 '18 at 7:47













          @user11550 I added a Pacman facing in opposite direction.

          – marmot
          Apr 28 '18 at 11:09





          @user11550 I added a Pacman facing in opposite direction.

          – marmot
          Apr 28 '18 at 11:09




          2




          2





          This looks like it belongs on the fishing channel!

          – Steven B. Segletes
          Apr 30 '18 at 10:29





          This looks like it belongs on the fishing channel!

          – Steven B. Segletes
          Apr 30 '18 at 10:29













          @StevenB.Segletes Done.

          – marmot
          Jul 31 '18 at 23:05





          @StevenB.Segletes Done.

          – marmot
          Jul 31 '18 at 23:05











          19














          A picture version just to impress David Carlisle ;)



          documentclass[border=7pt]standalone
          usepackagecolor
          begindocument
          setlengthunitlength.5pt
          beginpicture(200,200)(-100,-100)
          qbezier(0,0)(43.5, 25)(87, 50)
          qbezier(87, 50)(58, 100)(0, 100)
          qbezier(0, 100)(-58, 100)(-87, 50)
          qbezier(-87, 50)(-115, 0)(-87, -50)
          qbezier(-87, -50)(-58, -100)(0, -100)
          qbezier(0, -100)(58, -100)(87, -50)
          qbezier(87, -50)(43.5, -25)(0, 0)
          colorred
          put(0,67)circle*30
          endpicture
          enddocument


          enter image description here






          share|improve this answer























          • well, you impress me too! (+1)

            – Zarko
            Apr 28 '18 at 9:28











          • And me too! :):):)

            – CarLaTeX
            Apr 28 '18 at 9:38






          • 11





            +1 strike against the tikz mafia:-)

            – David Carlisle
            Apr 28 '18 at 9:38











          • @DavidCarlisle the revolution is coming 50 years after May '68 ;)

            – Kpym
            Apr 28 '18 at 9:51















          19














          A picture version just to impress David Carlisle ;)



          documentclass[border=7pt]standalone
          usepackagecolor
          begindocument
          setlengthunitlength.5pt
          beginpicture(200,200)(-100,-100)
          qbezier(0,0)(43.5, 25)(87, 50)
          qbezier(87, 50)(58, 100)(0, 100)
          qbezier(0, 100)(-58, 100)(-87, 50)
          qbezier(-87, 50)(-115, 0)(-87, -50)
          qbezier(-87, -50)(-58, -100)(0, -100)
          qbezier(0, -100)(58, -100)(87, -50)
          qbezier(87, -50)(43.5, -25)(0, 0)
          colorred
          put(0,67)circle*30
          endpicture
          enddocument


          enter image description here






          share|improve this answer























          • well, you impress me too! (+1)

            – Zarko
            Apr 28 '18 at 9:28











          • And me too! :):):)

            – CarLaTeX
            Apr 28 '18 at 9:38






          • 11





            +1 strike against the tikz mafia:-)

            – David Carlisle
            Apr 28 '18 at 9:38











          • @DavidCarlisle the revolution is coming 50 years after May '68 ;)

            – Kpym
            Apr 28 '18 at 9:51













          19












          19








          19







          A picture version just to impress David Carlisle ;)



          documentclass[border=7pt]standalone
          usepackagecolor
          begindocument
          setlengthunitlength.5pt
          beginpicture(200,200)(-100,-100)
          qbezier(0,0)(43.5, 25)(87, 50)
          qbezier(87, 50)(58, 100)(0, 100)
          qbezier(0, 100)(-58, 100)(-87, 50)
          qbezier(-87, 50)(-115, 0)(-87, -50)
          qbezier(-87, -50)(-58, -100)(0, -100)
          qbezier(0, -100)(58, -100)(87, -50)
          qbezier(87, -50)(43.5, -25)(0, 0)
          colorred
          put(0,67)circle*30
          endpicture
          enddocument


          enter image description here






          share|improve this answer













          A picture version just to impress David Carlisle ;)



          documentclass[border=7pt]standalone
          usepackagecolor
          begindocument
          setlengthunitlength.5pt
          beginpicture(200,200)(-100,-100)
          qbezier(0,0)(43.5, 25)(87, 50)
          qbezier(87, 50)(58, 100)(0, 100)
          qbezier(0, 100)(-58, 100)(-87, 50)
          qbezier(-87, 50)(-115, 0)(-87, -50)
          qbezier(-87, -50)(-58, -100)(0, -100)
          qbezier(0, -100)(58, -100)(87, -50)
          qbezier(87, -50)(43.5, -25)(0, 0)
          colorred
          put(0,67)circle*30
          endpicture
          enddocument


          enter image description here







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Apr 28 '18 at 9:23









          KpymKpym

          17.8k24191




          17.8k24191












          • well, you impress me too! (+1)

            – Zarko
            Apr 28 '18 at 9:28











          • And me too! :):):)

            – CarLaTeX
            Apr 28 '18 at 9:38






          • 11





            +1 strike against the tikz mafia:-)

            – David Carlisle
            Apr 28 '18 at 9:38











          • @DavidCarlisle the revolution is coming 50 years after May '68 ;)

            – Kpym
            Apr 28 '18 at 9:51

















          • well, you impress me too! (+1)

            – Zarko
            Apr 28 '18 at 9:28











          • And me too! :):):)

            – CarLaTeX
            Apr 28 '18 at 9:38






          • 11





            +1 strike against the tikz mafia:-)

            – David Carlisle
            Apr 28 '18 at 9:38











          • @DavidCarlisle the revolution is coming 50 years after May '68 ;)

            – Kpym
            Apr 28 '18 at 9:51
















          well, you impress me too! (+1)

          – Zarko
          Apr 28 '18 at 9:28





          well, you impress me too! (+1)

          – Zarko
          Apr 28 '18 at 9:28













          And me too! :):):)

          – CarLaTeX
          Apr 28 '18 at 9:38





          And me too! :):):)

          – CarLaTeX
          Apr 28 '18 at 9:38




          11




          11





          +1 strike against the tikz mafia:-)

          – David Carlisle
          Apr 28 '18 at 9:38





          +1 strike against the tikz mafia:-)

          – David Carlisle
          Apr 28 '18 at 9:38













          @DavidCarlisle the revolution is coming 50 years after May '68 ;)

          – Kpym
          Apr 28 '18 at 9:51





          @DavidCarlisle the revolution is coming 50 years after May '68 ;)

          – Kpym
          Apr 28 '18 at 9:51











          15














          An alternative solution with tkz-euclide, unfortunately the documentation is in French only, but there are many examples very easy to understand.



          documentclassarticle
          usepackagetkz-euclide
          usetkzobjall

          begindocument
          begintikzpicture
          tkzDefPoint(0,0)O
          tkzDefPoint(0,1)A
          tkzDrawSector[R,draw=black,thick,fill=yellow](O,2cm)(30,330)
          tkzDrawCircle[R, fill=black](A,.3cm)
          tkzDefPoint(4.5,0)O2
          tkzDefPoint(4.5,1)A2
          tkzDrawSector[R,draw=black,thick,fill=yellow](O2,2cm)(210,150)
          tkzDrawCircle[R, fill=black](A2,.3cm)
          endtikzpicture
          enddocument


          enter image description here






          share|improve this answer























          • nice (+1)! i'm not familiar tkz-euclide, but now see one reason more why make me more familiar with it :-)

            – Zarko
            Apr 28 '18 at 9:21






          • 4





            @Zarko Thank you! I think the package would be more popular if there was an English documentation :):):)

            – CarLaTeX
            Apr 28 '18 at 9:34















          15














          An alternative solution with tkz-euclide, unfortunately the documentation is in French only, but there are many examples very easy to understand.



          documentclassarticle
          usepackagetkz-euclide
          usetkzobjall

          begindocument
          begintikzpicture
          tkzDefPoint(0,0)O
          tkzDefPoint(0,1)A
          tkzDrawSector[R,draw=black,thick,fill=yellow](O,2cm)(30,330)
          tkzDrawCircle[R, fill=black](A,.3cm)
          tkzDefPoint(4.5,0)O2
          tkzDefPoint(4.5,1)A2
          tkzDrawSector[R,draw=black,thick,fill=yellow](O2,2cm)(210,150)
          tkzDrawCircle[R, fill=black](A2,.3cm)
          endtikzpicture
          enddocument


          enter image description here






          share|improve this answer























          • nice (+1)! i'm not familiar tkz-euclide, but now see one reason more why make me more familiar with it :-)

            – Zarko
            Apr 28 '18 at 9:21






          • 4





            @Zarko Thank you! I think the package would be more popular if there was an English documentation :):):)

            – CarLaTeX
            Apr 28 '18 at 9:34













          15












          15








          15







          An alternative solution with tkz-euclide, unfortunately the documentation is in French only, but there are many examples very easy to understand.



          documentclassarticle
          usepackagetkz-euclide
          usetkzobjall

          begindocument
          begintikzpicture
          tkzDefPoint(0,0)O
          tkzDefPoint(0,1)A
          tkzDrawSector[R,draw=black,thick,fill=yellow](O,2cm)(30,330)
          tkzDrawCircle[R, fill=black](A,.3cm)
          tkzDefPoint(4.5,0)O2
          tkzDefPoint(4.5,1)A2
          tkzDrawSector[R,draw=black,thick,fill=yellow](O2,2cm)(210,150)
          tkzDrawCircle[R, fill=black](A2,.3cm)
          endtikzpicture
          enddocument


          enter image description here






          share|improve this answer













          An alternative solution with tkz-euclide, unfortunately the documentation is in French only, but there are many examples very easy to understand.



          documentclassarticle
          usepackagetkz-euclide
          usetkzobjall

          begindocument
          begintikzpicture
          tkzDefPoint(0,0)O
          tkzDefPoint(0,1)A
          tkzDrawSector[R,draw=black,thick,fill=yellow](O,2cm)(30,330)
          tkzDrawCircle[R, fill=black](A,.3cm)
          tkzDefPoint(4.5,0)O2
          tkzDefPoint(4.5,1)A2
          tkzDrawSector[R,draw=black,thick,fill=yellow](O2,2cm)(210,150)
          tkzDrawCircle[R, fill=black](A2,.3cm)
          endtikzpicture
          enddocument


          enter image description here







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Apr 28 '18 at 7:12









          CarLaTeXCarLaTeX

          34.5k552141




          34.5k552141












          • nice (+1)! i'm not familiar tkz-euclide, but now see one reason more why make me more familiar with it :-)

            – Zarko
            Apr 28 '18 at 9:21






          • 4





            @Zarko Thank you! I think the package would be more popular if there was an English documentation :):):)

            – CarLaTeX
            Apr 28 '18 at 9:34

















          • nice (+1)! i'm not familiar tkz-euclide, but now see one reason more why make me more familiar with it :-)

            – Zarko
            Apr 28 '18 at 9:21






          • 4





            @Zarko Thank you! I think the package would be more popular if there was an English documentation :):):)

            – CarLaTeX
            Apr 28 '18 at 9:34
















          nice (+1)! i'm not familiar tkz-euclide, but now see one reason more why make me more familiar with it :-)

          – Zarko
          Apr 28 '18 at 9:21





          nice (+1)! i'm not familiar tkz-euclide, but now see one reason more why make me more familiar with it :-)

          – Zarko
          Apr 28 '18 at 9:21




          4




          4





          @Zarko Thank you! I think the package would be more popular if there was an English documentation :):):)

          – CarLaTeX
          Apr 28 '18 at 9:34





          @Zarko Thank you! I think the package would be more popular if there was an English documentation :):):)

          – CarLaTeX
          Apr 28 '18 at 9:34











          6














          Ascii verbatim version.



          documentclass[preview]standalone
          begindocument
          ttfamilytiny
          beginverbatim


          `..--:::::--..`
          `-/+osssoo++++++++oosssso+/-`
          -/osso/::-------------------::+osso/.
          `:oyo+:-------------------------------:+syo:`
          `:syo:----------------:/+++/-----------------/oyo-
          .+yo:-----------------:ymNMMMNms:-----------------/sy/`
          .oy+-------------------:mMMMMMMMMMd-------------------:oy+`
          `oy+---------------------sMMMMMMMMMMM+---------------------oh/`
          :ho-----------------------+MMMMMMMMMMN:----------------------:sy-
          `oh:-------------------------omMMMMMMMm+-------------------------/h+
          .hs----------------------------:+shhhs+----------------------------:hy
          .do---------------------------------------------------------------:oys/`
          .d+------------------------------------------------------------:/syo:`
          `ho----------------------------------------------------------:+ys+-
          oh--------------------------------------------------------/oyo:`
          .N:----------------------------------------------------:+sy+-
          ys--------------------------------------------------:oys/.
          `N:-----------------------------------------------+syo-
          /d--------------------------------------------:oys/.
          sy-----------------------------------------/syo:
          ys-------------------------------------:oyy+.
          ys--------------------------------------oyy+.
          sy-----------------------------------------/sys:`
          /d--------------------------------------------:oyy+.
          `N:-----------------------------------------------/syo:`
          ys--------------------------------------------------:oys/.
          .N:----------------------------------------------------:+syo-
          oh--------------------------------------------------------/oys/.
          `ho----------------------------------------------------------:+ss+-
          .d+------------------------------------------------------------:/syo:`
          .do---------------------------------------------------------------:oss+`
          .hs----------------------------------------------------------------:hs
          `oh:-------------------------------------------------------------/h+
          :ho----------------------------------------------------------:sy-
          `+h+-------------------------------------------------------oh/`
          .oy+--------------------------------------------------:oy+`
          .+yo/---------------------------------------------/sy/`
          `:syo:---------------------------------------/oyo-
          `:oys+:-------------------------------:+sso:`
          -/osso+::-------------------:/+osso:.
          `-/+ossssoo+++++++oosssso+:-`
          `..--:::::--.``


          endverbatim
          enddocument


          enter image description here






          share|improve this answer



























            6














            Ascii verbatim version.



            documentclass[preview]standalone
            begindocument
            ttfamilytiny
            beginverbatim


            `..--:::::--..`
            `-/+osssoo++++++++oosssso+/-`
            -/osso/::-------------------::+osso/.
            `:oyo+:-------------------------------:+syo:`
            `:syo:----------------:/+++/-----------------/oyo-
            .+yo:-----------------:ymNMMMNms:-----------------/sy/`
            .oy+-------------------:mMMMMMMMMMd-------------------:oy+`
            `oy+---------------------sMMMMMMMMMMM+---------------------oh/`
            :ho-----------------------+MMMMMMMMMMN:----------------------:sy-
            `oh:-------------------------omMMMMMMMm+-------------------------/h+
            .hs----------------------------:+shhhs+----------------------------:hy
            .do---------------------------------------------------------------:oys/`
            .d+------------------------------------------------------------:/syo:`
            `ho----------------------------------------------------------:+ys+-
            oh--------------------------------------------------------/oyo:`
            .N:----------------------------------------------------:+sy+-
            ys--------------------------------------------------:oys/.
            `N:-----------------------------------------------+syo-
            /d--------------------------------------------:oys/.
            sy-----------------------------------------/syo:
            ys-------------------------------------:oyy+.
            ys--------------------------------------oyy+.
            sy-----------------------------------------/sys:`
            /d--------------------------------------------:oyy+.
            `N:-----------------------------------------------/syo:`
            ys--------------------------------------------------:oys/.
            .N:----------------------------------------------------:+syo-
            oh--------------------------------------------------------/oys/.
            `ho----------------------------------------------------------:+ss+-
            .d+------------------------------------------------------------:/syo:`
            .do---------------------------------------------------------------:oss+`
            .hs----------------------------------------------------------------:hs
            `oh:-------------------------------------------------------------/h+
            :ho----------------------------------------------------------:sy-
            `+h+-------------------------------------------------------oh/`
            .oy+--------------------------------------------------:oy+`
            .+yo/---------------------------------------------/sy/`
            `:syo:---------------------------------------/oyo-
            `:oys+:-------------------------------:+sso:`
            -/osso+::-------------------:/+osso:.
            `-/+ossssoo+++++++oosssso+:-`
            `..--:::::--.``


            endverbatim
            enddocument


            enter image description here






            share|improve this answer

























              6












              6








              6







              Ascii verbatim version.



              documentclass[preview]standalone
              begindocument
              ttfamilytiny
              beginverbatim


              `..--:::::--..`
              `-/+osssoo++++++++oosssso+/-`
              -/osso/::-------------------::+osso/.
              `:oyo+:-------------------------------:+syo:`
              `:syo:----------------:/+++/-----------------/oyo-
              .+yo:-----------------:ymNMMMNms:-----------------/sy/`
              .oy+-------------------:mMMMMMMMMMd-------------------:oy+`
              `oy+---------------------sMMMMMMMMMMM+---------------------oh/`
              :ho-----------------------+MMMMMMMMMMN:----------------------:sy-
              `oh:-------------------------omMMMMMMMm+-------------------------/h+
              .hs----------------------------:+shhhs+----------------------------:hy
              .do---------------------------------------------------------------:oys/`
              .d+------------------------------------------------------------:/syo:`
              `ho----------------------------------------------------------:+ys+-
              oh--------------------------------------------------------/oyo:`
              .N:----------------------------------------------------:+sy+-
              ys--------------------------------------------------:oys/.
              `N:-----------------------------------------------+syo-
              /d--------------------------------------------:oys/.
              sy-----------------------------------------/syo:
              ys-------------------------------------:oyy+.
              ys--------------------------------------oyy+.
              sy-----------------------------------------/sys:`
              /d--------------------------------------------:oyy+.
              `N:-----------------------------------------------/syo:`
              ys--------------------------------------------------:oys/.
              .N:----------------------------------------------------:+syo-
              oh--------------------------------------------------------/oys/.
              `ho----------------------------------------------------------:+ss+-
              .d+------------------------------------------------------------:/syo:`
              .do---------------------------------------------------------------:oss+`
              .hs----------------------------------------------------------------:hs
              `oh:-------------------------------------------------------------/h+
              :ho----------------------------------------------------------:sy-
              `+h+-------------------------------------------------------oh/`
              .oy+--------------------------------------------------:oy+`
              .+yo/---------------------------------------------/sy/`
              `:syo:---------------------------------------/oyo-
              `:oys+:-------------------------------:+sso:`
              -/osso+::-------------------:/+osso:.
              `-/+ossssoo+++++++oosssso+:-`
              `..--:::::--.``


              endverbatim
              enddocument


              enter image description here






              share|improve this answer













              Ascii verbatim version.



              documentclass[preview]standalone
              begindocument
              ttfamilytiny
              beginverbatim


              `..--:::::--..`
              `-/+osssoo++++++++oosssso+/-`
              -/osso/::-------------------::+osso/.
              `:oyo+:-------------------------------:+syo:`
              `:syo:----------------:/+++/-----------------/oyo-
              .+yo:-----------------:ymNMMMNms:-----------------/sy/`
              .oy+-------------------:mMMMMMMMMMd-------------------:oy+`
              `oy+---------------------sMMMMMMMMMMM+---------------------oh/`
              :ho-----------------------+MMMMMMMMMMN:----------------------:sy-
              `oh:-------------------------omMMMMMMMm+-------------------------/h+
              .hs----------------------------:+shhhs+----------------------------:hy
              .do---------------------------------------------------------------:oys/`
              .d+------------------------------------------------------------:/syo:`
              `ho----------------------------------------------------------:+ys+-
              oh--------------------------------------------------------/oyo:`
              .N:----------------------------------------------------:+sy+-
              ys--------------------------------------------------:oys/.
              `N:-----------------------------------------------+syo-
              /d--------------------------------------------:oys/.
              sy-----------------------------------------/syo:
              ys-------------------------------------:oyy+.
              ys--------------------------------------oyy+.
              sy-----------------------------------------/sys:`
              /d--------------------------------------------:oyy+.
              `N:-----------------------------------------------/syo:`
              ys--------------------------------------------------:oys/.
              .N:----------------------------------------------------:+syo-
              oh--------------------------------------------------------/oys/.
              `ho----------------------------------------------------------:+ss+-
              .d+------------------------------------------------------------:/syo:`
              .do---------------------------------------------------------------:oss+`
              .hs----------------------------------------------------------------:hs
              `oh:-------------------------------------------------------------/h+
              :ho----------------------------------------------------------:sy-
              `+h+-------------------------------------------------------oh/`
              .oy+--------------------------------------------------:oy+`
              .+yo/---------------------------------------------/sy/`
              `:syo:---------------------------------------/oyo-
              `:oys+:-------------------------------:+sso:`
              -/osso+::-------------------:/+osso:.
              `-/+ossssoo+++++++oosssso+:-`
              `..--:::::--.``


              endverbatim
              enddocument


              enter image description here







              share|improve this answer












              share|improve this answer



              share|improve this answer










              answered Apr 30 '18 at 7:18









              KpymKpym

              17.8k24191




              17.8k24191





















                  5














                  Code golfing version.



                  documentclass[tikz,border=7pt]standalone
                  begindocument
                  tikzdraw[thick,fill=yellow](0,0)--(30:1)arc(30:330:1)--cycle;fill(0,2/3)circle(.15);
                  enddocument


                  enter image description here






                  share|improve this answer



























                    5














                    Code golfing version.



                    documentclass[tikz,border=7pt]standalone
                    begindocument
                    tikzdraw[thick,fill=yellow](0,0)--(30:1)arc(30:330:1)--cycle;fill(0,2/3)circle(.15);
                    enddocument


                    enter image description here






                    share|improve this answer

























                      5












                      5








                      5







                      Code golfing version.



                      documentclass[tikz,border=7pt]standalone
                      begindocument
                      tikzdraw[thick,fill=yellow](0,0)--(30:1)arc(30:330:1)--cycle;fill(0,2/3)circle(.15);
                      enddocument


                      enter image description here






                      share|improve this answer













                      Code golfing version.



                      documentclass[tikz,border=7pt]standalone
                      begindocument
                      tikzdraw[thick,fill=yellow](0,0)--(30:1)arc(30:330:1)--cycle;fill(0,2/3)circle(.15);
                      enddocument


                      enter image description here







                      share|improve this answer












                      share|improve this answer



                      share|improve this answer










                      answered Apr 30 '18 at 7:22









                      KpymKpym

                      17.8k24191




                      17.8k24191





















                          4














                          Plain Metapost version:



                          prologues := 3;
                          outputtemplate := "%j%c.eps";
                          beginfig(1);
                          path P;
                          P = origin -- subpath 1/2(1,15) of fullcircle scaled 42 -- cycle;
                          fill P withcolor red+green; draw P;
                          fill fullcircle scaled 7 shifted 14 up;
                          endfig;
                          end.


                          enter image description here






                          share|improve this answer





























                            4














                            Plain Metapost version:



                            prologues := 3;
                            outputtemplate := "%j%c.eps";
                            beginfig(1);
                            path P;
                            P = origin -- subpath 1/2(1,15) of fullcircle scaled 42 -- cycle;
                            fill P withcolor red+green; draw P;
                            fill fullcircle scaled 7 shifted 14 up;
                            endfig;
                            end.


                            enter image description here






                            share|improve this answer



























                              4












                              4








                              4







                              Plain Metapost version:



                              prologues := 3;
                              outputtemplate := "%j%c.eps";
                              beginfig(1);
                              path P;
                              P = origin -- subpath 1/2(1,15) of fullcircle scaled 42 -- cycle;
                              fill P withcolor red+green; draw P;
                              fill fullcircle scaled 7 shifted 14 up;
                              endfig;
                              end.


                              enter image description here






                              share|improve this answer















                              Plain Metapost version:



                              prologues := 3;
                              outputtemplate := "%j%c.eps";
                              beginfig(1);
                              path P;
                              P = origin -- subpath 1/2(1,15) of fullcircle scaled 42 -- cycle;
                              fill P withcolor red+green; draw P;
                              fill fullcircle scaled 7 shifted 14 up;
                              endfig;
                              end.


                              enter image description here







                              share|improve this answer














                              share|improve this answer



                              share|improve this answer








                              edited 10 mins ago









                              JouleV

                              13k22663




                              13k22663










                              answered May 11 '18 at 19:41









                              ThrustonThruston

                              27k24492




                              27k24492





















                                  3














                                  A trivial solution with PSTricks.



                                  documentclass[pstricks]standalone
                                  begindocument
                                  pspicture(6,6)
                                  pswedge[fillstyle=solid,fillcolor=yellow](3,3)315345
                                  qdisk(3.5,4.5).5
                                  endpspicture
                                  enddocument


                                  enter image description here






                                  share|improve this answer



























                                    3














                                    A trivial solution with PSTricks.



                                    documentclass[pstricks]standalone
                                    begindocument
                                    pspicture(6,6)
                                    pswedge[fillstyle=solid,fillcolor=yellow](3,3)315345
                                    qdisk(3.5,4.5).5
                                    endpspicture
                                    enddocument


                                    enter image description here






                                    share|improve this answer

























                                      3












                                      3








                                      3







                                      A trivial solution with PSTricks.



                                      documentclass[pstricks]standalone
                                      begindocument
                                      pspicture(6,6)
                                      pswedge[fillstyle=solid,fillcolor=yellow](3,3)315345
                                      qdisk(3.5,4.5).5
                                      endpspicture
                                      enddocument


                                      enter image description here






                                      share|improve this answer













                                      A trivial solution with PSTricks.



                                      documentclass[pstricks]standalone
                                      begindocument
                                      pspicture(6,6)
                                      pswedge[fillstyle=solid,fillcolor=yellow](3,3)315345
                                      qdisk(3.5,4.5).5
                                      endpspicture
                                      enddocument


                                      enter image description here







                                      share|improve this answer












                                      share|improve this answer



                                      share|improve this answer










                                      answered Oct 21 '18 at 17:55









                                      Artificial Hairless ArmpitArtificial Hairless Armpit

                                      5,06411243




                                      5,06411243



























                                          draft saved

                                          draft discarded
















































                                          Thanks for contributing an answer to TeX - LaTeX Stack Exchange!


                                          • Please be sure to answer the question. Provide details and share your research!

                                          But avoid


                                          • Asking for help, clarification, or responding to other answers.

                                          • Making statements based on opinion; back them up with references or personal experience.

                                          To learn more, see our tips on writing great answers.




                                          draft saved


                                          draft discarded














                                          StackExchange.ready(
                                          function ()
                                          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f428967%2fpacman-circle-in-tikz%23new-answer', 'question_page');

                                          );

                                          Post as a guest















                                          Required, but never shown





















































                                          Required, but never shown














                                          Required, but never shown












                                          Required, but never shown







                                          Required, but never shown

































                                          Required, but never shown














                                          Required, but never shown












                                          Required, but never shown







                                          Required, but never shown







                                          Popular posts from this blog

                                          Isabella Eugénie Boyer Biographie | Références | Menu de navigationmodifiermodifier le codeComparator to Compute the Relative Value of a U.S. Dollar Amount – 1774 to Present.

                                          Lioubotyn Sommaire Géographie | Histoire | Population | Notes et références | Liens externes | Menu de navigationlubotin.kharkov.uamodifier« Recensements et estimations de la population depuis 1897 »« Office des statistiques d'Ukraine : population au 1er janvier 2010, 2011 et 2012 »« Office des statistiques d'Ukraine : population au 1er janvier 2011, 2012 et 2013 »Informations officiellesCartes topographiquesCarte routièrem

                                          Mpande kaSenzangakhona Biographie | Références | Menu de navigationmodifierMpande kaSenzangakhonavoir la liste des auteursm