更新:

更新:

在此处输入图片描述

在等边三角形内画一个圆。再画一个过三角形三个顶点的圆。三角形外大圆内的一个区域被阴影部分覆盖。小圆外三角形内的区域被阴影部分覆盖。

阴影对我来说太难了。

\documentclass[10pt]{article}
\usepackage{pgf,tikz}
\usepackage{mathrsfs}
\usetikzlibrary{arrows}
\pagestyle{empty}
\begin{document}
\begin{tikzpicture}
\draw (8.,0.) -- (14.,0.) -- (11.,5.196152422706633) -- cycle;
\draw(11.,1.7320508075688779) circle (1.7320508075688772cm);
\draw(11.,1.7320508075688787) circle (3.4641016151377544cm);
\begin{scriptsize}
\draw  (8.,0.) circle (1.5pt);
\draw  (14.,0.) circle (1.5pt);
\draw  (11.,5.196152422706633) circle (1.5pt);
\draw (9.5,2.5980762113533165) circle (1.5pt);
\draw  (12.5,2.5980762113533165) circle (1.5pt);
\draw (11.,0.) circle (1.5pt);
\end{scriptsize}
\end{tikzpicture}
\end{document}

我也想要一个类似的图形,只是用正方形代替了三角形。

答案1

一种选择:

\documentclass[border=5pt]{standalone}
\usepackage{tikz}
\definecolor{mypurple}{RGB}{236,145,191}

\newlength\Radius
\setlength\Radius{2cm}

\begin{document}

\begin{tikzpicture}[line join=round]
\filldraw[fill=mypurple,even odd rule]
  (0,0) -- node[above] {$R$} (210:\Radius) arc [start angle=210,end angle=90,radius=\Radius] -- (0,0)
  (210:\Radius) -- (90:\Radius) -- (0,0)
  (0,0) -- (30:0.5\Radius) arc [start angle=30,end angle=-90,radius=0.5\Radius] --(0,0)
  (30:0.5\Radius) -- (-30:\Radius) -- (-90:0.5\Radius) -- (0,0);
\draw 
  (0,0) circle [radius=\Radius]
  (0,0) circle [radius=0.5\Radius]
  (90:\Radius) -- (210:\Radius) -- (-30:\Radius) -- cycle
  (0,0) -- (-30:0.5\Radius) node[midway,above] {$r$};
\fill (0,0) circle [radius=1.5pt];
\end{tikzpicture}

\end{document}

在此处输入图片描述

方形外壳:

\documentclass[border=5pt]{standalone}
\usepackage{tikz}
\definecolor{mypurple}{RGB}{236,145,191}

\newlength\Radius
\setlength\Radius{2cm}

\begin{document}

\begin{tikzpicture}[line join=round]
\fill[fill=mypurple,even odd rule,draw=white]
  (0,0) -- (0:{\Radius/sqrt(2)}) arc[start angle=0,end angle=-90,radius=\Radius/sqrt(2)] -- (0,0) rectangle (-45:\Radius)
  (0,0) -- (45:\Radius) arc[start angle=45,end angle=135,radius=\Radius] -- (0,0) -- (45:\Radius) -- (135:\Radius) -- cycle ;
\draw
  (0,0) circle [radius=\Radius]
  (225:\Radius) rectangle (45:\Radius)
  (0,0) circle [radius=\Radius/sqrt(2)];
\fill (0,0) circle [radius=1.5pt];
\draw 
  (225:\Radius) -- node[above left=-1pt] {$R$} (0,0) -- node[above right=-1pt] {$r$} (-45:{\Radius/sqrt(2)}); 
\end{tikzpicture}

\end{document}

在此处输入图片描述

更新:

没有even odd rule

\documentclass[border=5pt]{standalone}
\usepackage{tikz}
\definecolor{mypurple}{RGB}{236,145,191}

\newlength\Radius
\setlength\Radius{2cm}

\begin{document}

\begin{tikzpicture}[line join=round]
\fill[fill=mypurple]
  (210:\Radius) arc [start angle=210,end angle=90,radius=\Radius] -- cycle
  (30:0.5\Radius) arc [start angle=30,end angle=-90,radius=0.5\Radius] -- (-30:\Radius) -- cycle;
\draw 
  (0,0) circle [radius=\Radius]
  (0,0) circle [radius=0.5\Radius]
  (90:\Radius) -- (210:\Radius) -- (-30:\Radius) -- cycle
  (0,0) -- (210:\Radius) node[midway,above] {$R$}
  (0,0) -- (-30:0.5\Radius) node[midway,above] {$r$}
  (90:\Radius) -- (90:-0.5\Radius);
\fill (0,0) circle [radius=1.5pt];
\end{tikzpicture}

\begin{tikzpicture}[line join=round]
\fill[fill=mypurple]
  (0:{\Radius/sqrt(2)}) arc[start angle=0,end angle=-90,radius=\Radius/sqrt(2)] -- (-45:\Radius) -- cycle
  (45:\Radius) arc[start angle=45,end angle=135,radius=\Radius] -- cycle ;
\draw
  (0,0) circle [radius=\Radius]
  (225:\Radius) rectangle (45:\Radius)
  (0,0) circle [radius=\Radius/sqrt(2)];
\fill (0,0) circle [radius=1.5pt];
\draw 
  (225:\Radius) -- node[above left=-1pt] {$R$} (0,0) -- node[above right=-1pt] {$r$} (-45:{\Radius/sqrt(2)}); 
\end{tikzpicture}

\end{document}

答案2

仅供参考...

\documentclass[tikz,border=5]{standalone}
\tikzset{rfill/.code={%
\pgfmathsetmacro\r{rnd}\pgfmathsetmacro\g{rnd}\pgfmathsetmacro\b{rnd}%
\definecolor{.}{rgb}{\r,\g,\b}%
\pgfsetfillcolor{.}%
}}
\begin{document}
\begin{tikzpicture}[every path/.style={rfill}]
\fill (0:0)   -- (90:1/2)  arc (90:-30:1/2)  -- cycle;
\fill (0:0)   -- (90:1/2)  arc (90:210:1/2)  -- cycle;
\fill (0:0)   -- (210:1/2) arc (210:270:1/2) -- cycle;
\fill (0:0)   -- (270:1/2) arc (270:330:1/2) -- cycle;
\fill (90:1)  -- (90:1/2)  arc (90:30:1/2)   -- cycle;
\fill (90:1)  -- (90:1/2)  arc (90:150:1/2)  -- cycle;
\fill (330:1) -- (30:1/2)  arc (30:-90:1/2)  -- cycle;
\fill (210:1) -- (150:1/2) arc (150:210:1/2) -- cycle;
\fill (210:1) -- (270:1/2) arc (270:210:1/2) -- cycle;
\fill (90:1)  arc (90:-30:1)  -- cycle;
\fill (90:1)  arc (90:210:1)  -- cycle;
\fill (210:1) arc (210:330:1) -- cycle;
\end{tikzpicture}
\end{document}

在此处输入图片描述

和...

\documentclass[tikz,border=5]{standalone}
\tikzset{rfill/.code={%
\pgfmathsetmacro\r{rnd}\pgfmathsetmacro\g{rnd}\pgfmathsetmacro\b{rnd}%
\definecolor{.}{rgb}{\r,\g,\b}%
\pgfsetfillcolor{.}%
}}
\begin{document}
\begin{tikzpicture}[every path/.style={rfill}]
\fill (0:0) -- (-45:1/sqrt 2) arc (-45:225:1/sqrt 2) -- cycle;
\fill (0:0) -- (225:1/sqrt 2) arc (225:315:1/sqrt 2) -- cycle;
\fill (90:1/sqrt 2)  arc (90:0:1/sqrt 2)    |- cycle;
\fill (90:1/sqrt 2)  arc (90:180:1/sqrt 2)  |- cycle;
\fill (270:1/sqrt 2) arc (270:360:1/sqrt 2) |- cycle;
\fill (270:1/sqrt 2) arc (270:225:1/sqrt 2) -- (225:1) -- cycle;
\fill (180:1/sqrt 2) arc (180:225:1/sqrt 2) -- (225:1) -- cycle;
\fill (45:1)  arc (45:135:1) -- cycle;
\fill (135:1) arc (135:225:1) -- cycle;
\fill (225:1) arc (225:315:1) -- cycle;
\fill (315:1) arc (315:405:1) -- cycle;
\end{tikzpicture}
\end{document}

在此处输入图片描述

答案3

nodes这只是使用(circleregular polygon)代替线条的另一种选择。

\documentclass[tikz, border=5pt]{standalone}
\usepackage{tikz}
\usetikzlibrary{shapes.geometric}
\definecolor{mypurple}{RGB}{236,145,191}

\newlength\Radius
\setlength\Radius{2cm}

\begin{document}

\begin{tikzpicture}[line join=round]

% circular nodes: minimum size=diameter  
\node[draw, circle, minimum width=2\Radius, inner sep=0pt, outer sep=0pt] (outer) {};
\node[draw, circle, minimum width=\Radius, inner sep=0pt, outer sep=0pt] (inner) {};

% regular polygon with 3 sides. minimum size=diameter of circumcircle
\node[draw, regular polygon, regular polygon sides=3, 
      minimum size=2\Radius, inner sep=0pt, outer sep=0pt] (tri) {};

\filldraw[fill=mypurple] (outer.north) arc[start angle=90, end angle=210, radius=\Radius]
         --cycle;
\filldraw[fill=mypurple] (inner.30) arc[start angle=30, end angle=-90, radius=.5\Radius]
         --(outer.-30)--cycle;

\draw (outer.210)--(inner.30) node[above,pos=.4] {$R$};
\draw (outer.90)--(inner.-90);
\draw (outer.center)--(inner.-30) node[midway,above]{$r$};
\fill (outer.center) circle (1pt);
\end{tikzpicture}

\end{document}

在此处输入图片描述

相关内容