我想用 重新创建以下内容tikz
。
这是我的 MWE
\documentclass{standalone}
\usepackage{pgfplots}
\usetikzlibrary{arrows}
\begin{document}
\begin{tikzpicture}
\draw[fill=gray!40] (0,0) -- +(45:2) arc (45:0:2);
\draw[ultra thick]
(0,0) circle [radius=2];
\draw[thick]
(0,-2)--(0,2) (-2,0)--(2,0)
(-135:2)--(45:2)
(135:2)--(-45:2);
\end{tikzpicture}
\begin{tikzpicture}
\draw [shift={(1,2)}, fill=gray!40] (0,0) -- plot[domain=4.248:5.176,variable=\t]({1*2.236*cos(\t r)+0*2.236*sin(\t r)},{0*2.236*cos(\t r)+1*2.236*sin(\t r)}) -- cycle ;
\draw [shift={(2,0)}, fill=gray!40] (0,0) -- plot[domain=1.111:2.034,variable=\t]({1*2.231*cos(\t r)+0*2.231*sin(\t r)},{0*2.231*cos(\t r)+1*2.231*sin(\t r)}) -- cycle ;
\draw [shift={(3,2)}, fill=gray!40] (0,0) -- plot[domain=4.252:5.176,variable=\t]({1*2.231*cos(\t r)+0*2.231*sin(\t r)},{0*2.231*cos(\t r)+1*2.231*sin(\t r)}) -- cycle ;
\draw [shift={(4,0)}, fill=gray!40] (0,0) -- plot[domain=1.107:2.034,variable=\t]({1*2.236*cos(\t r)+0*2.236*sin(\t r)},{0*2.236*cos(\t r)+1*2.236*sin(\t r)}) -- cycle ;
\draw [shift={(5,2)}, fill=gray!40] (0,0) -- plot[domain=4.248:5.176,variable=\t]({1*2.236*cos(\t r)+0*2.236*sin(\t r)},{0*2.236*cos(\t r)+1*2.236*sin(\t r)}) -- cycle ;
\draw [shift={(6,0)}, fill=gray!40] (0,0) -- plot[domain=1.107:2.034,variable=\t]({1*2.236*cos(\t r)+0*2.236*sin(\t r)},{0*2.236*cos(\t r)+1*2.236*sin(\t r)}) -- cycle ;
\draw [shift={(7,2)}, fill=gray!40] (0,0) -- plot[domain=4.248:5.176,variable=\t]({1*2.236*cos(\t r)+0*2.236*sin(\t r)},{0*2.236*cos(\t r)+1*2.236*sin(\t r)}) -- cycle ;
\draw [shift={(8,0)}, fill=gray!40] (0,0) -- plot[domain=1.107:2.034,variable=\t]({1*2.236*cos(\t r)+0*2.236*sin(\t r)},{0*2.236*cos(\t r)+1*2.236*sin(\t r)}) -- cycle ;
\end{tikzpicture}
\end{document}
答案1
这回答了问题吗?
\documentclass{standalone}
\usepackage{pgfplots}
\usetikzlibrary{arrows, calc, decorations, decorations.text,}
\begin{document}
\begin{tikzpicture}[>=latex']
\pgfmathsetmacro{\r}{2} % radius
\pgfmathsetmacro{\n}{10} % number of parts
\pgfmathsetmacro{\q}{4} % part extracted
\pgfmathsetmacro{\nn}{\n/2}
\pgfmathsetmacro{\angle}{360/\n} % angle of each part
\pgfmathsetmacro{\declx}{2*\r*sin(\angle/2)}
\pgfmathsetmacro{\decly}{\r*cos(\angle/2)}
\foreach \i in {1,...,\n}{
\draw [densely dotted, fill=gray!40] (0,0) -- +(\angle*\i:\r) arc (\angle*\i:\angle*(\i-1):\r);
}
\draw[ultra thick] (0,0) circle [radius=\r];
\draw [->, dashed, thin, postaction={decorate,decoration={raise=2pt,text along path,text={|\tiny|circumference $C$}}}] (90:2.\r) arc (90:-270:\r*1.1);
\draw [thick] (0,0) -- (\angle:\r) node [pos=.5, sloped, above] {$r$};
\draw [shift={(\angle*\q-\angle*.5:\r*1.5)}, thick, fill=gray!40] (0,0) -- +(\angle*\q:\r) node [pos=.5, left] {$r$} arc (\angle*\q:\angle*(\q-1):\r) node [pos=.5, above, sloped]{$C/\n$} -- cycle;
\draw [->] (\angle*\q-\angle*.5:\r*.5) to [out=90, in=40] (\angle*\q-\angle*.5:\r*2);
\foreach \i in {1,...,\nn}{
\draw [shift={(0,-6)}, fill=gray!40] (\declx*\i,0) -- +(90-\angle/2:\r) node (Sa) {} arc (90-\angle/2:90+\angle/2:\r) node (Sb) {} -- cycle;
\draw [shift={(0,-6)}, fill=gray!40] (\declx*\i+\declx/2,\decly) -- +(-90-\angle/2:\r) arc (-90-\angle/2:-90+\angle/2:\r) -- cycle;
\draw [dashed] (Sb.north) to [out=\angle/2, in=180-\angle/2] (Sa.north);
}
\node at ($(0,-6)+(\nn/2*\declx+\declx/2, \decly*1.3)$) {$C/2$};
\draw [xshift=-3pt, <->, dashed] (\declx,-6) --+(90+\angle/2:\r) node [pos=.5, left] {$r$};
\end{tikzpicture}
\end{document}