如何用 tikz 在三角形内绘制圆弧?

如何用 tikz 在三角形内绘制圆弧?

我想知道如何使用 tikz 或 tkz-euclide 绘制类似这样的图片。我真的不知道先做什么。

在此处输入图片描述

答案1

标签在你身上

\documentclass[tikz]{standalone}
\usetikzlibrary{calc}
\begin{document}
\begin{tikzpicture}
  \filldraw (0,2) -- (2,0) -| cycle (0,0) 
        arc (270:315:2) coordinate(a)--($(a)!2!(45:{sqrt(2)})$) arc (135:180:2);
\end{tikzpicture}
\end{document}

在此处输入图片描述

答案2

无需神奇数字(零除外)和角度计算的解决方案。

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{calc}

\begin{document}
\begin{tikzpicture}
  % The corners of the triangle
  % \Ay and \Cx are the length of the catheti of the right-angled triangle
  % and the radius for the circles in A and C.
  \def\Ay{2cm}
  \def\Cx{2cm}
  \path
    (0, \Ay) coordinate (A)
    (0, 0) coordinate (B)
    (\Cx, 0) coordinate (C)
  ;

  % The areas are filled by filling the two circles in A and B.
  % Because of the "even odd rule", the intersection is not filled.
  % The fill areas are limited to the triangle by clipping.
  % The local overlay removes the larger circles from the bounding
  % box calculations for the whole tikzpicture.
  \begin{scope}[overlay]
    \clip (A) -- (B) -- (C) -- cycle;
    \fill[even odd rule]
      (A) circle[radius=\Ay]
      (C) circle[radius=\Cx]
    ;
  \end{scope}

  % The triangle is drawn.
  \draw (A) -- (B) -- (C) -- cycle;

  % The annotations with the point names.
  \path
    (A) node[above left] {$A$}
    (B) node[below left] {$B$}
    (C) node[below right] {$C$}
    % The coordinates for D and E are calculated
    % via the syntax of distance modifiers.
    ($(C)!\Cx!0:(A)$) coordinate (D) node[above right] {$D$}
    ($(A)!\Ay!0:(C)$) coordinate (E) node[above right] {$E$}
  ;

\end{tikzpicture}
\end{document}

结果

答案3

与 percusse 的解决方案相比,它太冗长了,但我希望,它不是那么神秘。

\documentclass[tikz,border=2mm]{standalone}
\begin{document}
\begin{tikzpicture}
\draw (0,0) coordinate[label=above left:$A$] (A) --++(-90:2cm) coordinate[label=below left:$B$] (B) --++(0:2cm) coordinate[label=below right:$C$] (C) --cycle;

\fill (A)--(B) arc (180:135:2cm) coordinate[label=above right:$D$] (D)--cycle;

\fill (C)--(B) arc (-90:-45:2cm) coordinate[label=above right:$E$] (E)--cycle;
\end{tikzpicture}
\end{document}

在此处输入图片描述

相关内容