不使用 arc 或 pic 结构填充圆弧

不使用 arc 或 pic 结构填充圆弧

有没有不用 arc/pic 就能填充角度的方法?但参数方程必须保留。

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{positioning,scopes,backgrounds,calc,intersections,shapes.geometric,arrows}

\begin{document}
\begin{tikzpicture}
\coordinate (a) at (4,0);
\coordinate (b) at (7,0);
\coordinate (c) at (5.5,1.78763);
\draw (a) -- (b) -- (c) -- cycle;   
\draw [fill=red,domain=230:310] plot ({5.5+0.5*cos(\x)}, {1.78763+0.5*sin(\x)});
\draw [fill=blue,domain=0:59] plot ({4.1+0.5*cos(\x)}, {0+0.5*sin(\x)});
\draw [fill=blue,domain=121:180] plot ({6.9+0.5*cos(\x)}, {0+0.5*sin(\x)}); 
\end{tikzpicture}
\end{document}

图表在这里

答案1

只是填充区域缺少到顶点的线:

\documentclass{article}
\usepackage{tikz}

\begin{document}
\begin{tikzpicture}
  \coordinate (a) at (4,0);
  \coordinate (b) at (7,0);
  \coordinate (c) at (5.5,1.78763);

  \draw [fill=red,domain=230:310]
    plot ({5.5+0.5*cos(\x)}, {1.78763+0.5*sin(\x)})
    -- (c) -- cycle;
  \draw [fill=blue,domain=0:59]
    plot ({4.1+0.5*cos(\x)}, {0+0.5*sin(\x)})
    -- (a) -- cycle;
  \draw [fill=blue,domain=121:180]
    plot ({6.9+0.5*cos(\x)}, {0+0.5*sin(\x)})
    -- (b) -- cycle;

  \draw (a) -- (b) -- (c) -- cycle;
\end{tikzpicture}
\end{document}

结果

如果绘图命令中与真实弧的偏差不是故意的,则可以通过 TikZ 计算绘图参数:

\documentclass{article}
\usepackage{tikz}

\begin{document}
\begin{tikzpicture}
  \coordinate (a) at (4,0);
  \coordinate (b) at (7,0);
  \coordinate (c) at (5.5,1.78763);

  \newcommand*{\MyArc}[4]{%
    \pgfmathanglebetweenpoints
      {\pgfpointanchor{#1}{center}}%
      {\pgfpointanchor{#2}{center}}%
    \let\StartAngle\pgfmathresult
    \pgfmathanglebetweenpoints
      {\pgfpointanchor{#1}{center}}%
      {\pgfpointanchor{#3}{center}}%
    \let\EndAngle\pgfmathresult
    \draw[
      fill={#4},
      domain=\StartAngle:\EndAngle,
      shift=({#1}),
    ] plot ({0.5 * cos(\x)}, {0.5 * sin(\x)}) -- ({#1}) -- cycle;%
  }
  \MyArc{a}{b}{c}{blue}
  \MyArc{b}{c}{a}{blue}
  \MyArc{c}{a}{b}{red}

  \draw (a) -- (b) -- (c) -- cycle;
\end{tikzpicture}
\end{document}

结果

相关内容