答案1
所以主要的困难是箭头。我定义了一个myarrow
带有参数的样式,指示箭头的位置。
\documentclass[tikz,border=5mm]{standalone}
\usetikzlibrary{decorations.markings}
\begin{document}
\begin{tikzpicture}
\tikzset{myarrow/.style={postaction={decorate},
decoration={markings,% switch on markings
mark=at position #1 with {\arrow{>}},
}}}
\tikzset{dot/.style={circle,fill,inner sep=1pt}}
\def\R{2.5}
\def\r{.5}
\draw[fill=yellow!50,myarrow=.6] (\R,0) arc(0:-360:\R) node[pos=.6,left]{$a$};
\draw[fill=white,myarrow=.6] (\R/2+\r,0) arc(0:-360:\r) node[pos=.6,left]{$a$};
\draw[fill=white,myarrow=.6] (-\R/2+\r,0) arc(0:-360:\r) node[pos=.6,left]{$a$};
\path
(0,\R) node[dot] (x) {} node[above] {$x$}
(\R/2,\r) node[dot] (xR) {} node[above right]{$x$}
(-\R/2,\r) node[dot] (xL) {} node[above left]{$x$}
;
\draw[myarrow=.6] (x)--(xL) node[pos=.6,left]{$b$};
\draw[myarrow=.6] (x)--(xR) node[pos=.6,right]{$c$};
\path (0,-\R/2) node{$U$};
\end{tikzpicture}
\end{document}
您可以更改为arrows.meta
库中描述的其他箭头(请参阅手册)。
答案2
一个很好的@Black Mild 回答的一个小变化(+1):
\documentclass[tikz,border=5mm]{standalone}
\usetikzlibrary{arrows.meta,
decorations.markings,
quotes}
\begin{document}
\begin{tikzpicture}[
> = Straight Barb,
->-/.style = {decoration={markings,% switch on markings
mark=at position 0.4 with {\arrowreversed{>};
\node[label=left:$#1$]{}; }
},
draw, postaction={decorate},
},
->-/.default = a,
dot/.style = {circle,fill,inner sep=1.2pt, outer sep=0pt,
node contents={}},
every edge/.style = {pos=0.4,->-={}},
every edge quotes/.style = {auto, inner sep=2pt},
every label/.style = {inner sep=1pt}
]
\def\R{2.5cm}
\def\r{.5cm}
\draw[->-,fill=cyan] (0,0) circle[radius=\R];
\draw[->-,fill=white] (-\R/2,0) circle[radius=\r];
\draw[->-,fill=white] ( \R/2,0) circle[radius=\r];
\path (0,\R) node (x) [dot,label=$x$]
( \R/2,\r) node (xR) [dot,label= 75:$x$]
(-\R/2,\r) node (xL) [dot,label=105:$x$];
\draw (xL) edge["$b$"] (x)
(xR) edge["$c$" '] (x)
(0,-\R/2) node{$U$};
\end{tikzpicture}
\end{document}