绘制角度符号的问题

绘制角度符号的问题

我想要画这幅图:

![在此处输入图片描述

写下这段代码:

\documentclass{standalone}

\usepackage{tikz}

\usepackage{siunitx}
\usetikzlibrary{quotes}
\usetikzlibrary{angles}
\usetikzlibrary{arrows}
\usetikzlibrary{automata}
\usetikzlibrary{calc}
\usetikzlibrary{decorations.pathreplacing,decorations.markings}

\begin{document}

\begin{tikzpicture}[line cap=round]

  % First, define nodes
\node[inner sep=0pt, label={[inner sep=5pt]left:{$C$}}] (C) at (0, 0) {};  
\node[inner sep=0pt, label={[inner sep=5pt]right:{$D$}}] (D) at (5, 0) {};  
\node[inner sep=0pt, label={[inner sep=5pt]left:{$B$}}] (B) at (2.5, 4) {};  

  % Draw curved path
\draw [line width=2pt, -] (C) -- (D) -- (B) -- (C);
\draw [line width=2pt, ->] (C) -- ($(C)!1.3!(B)$);

  \pic[inner sep=2pt, right, "$\ang{50}$", draw=black, -, angle eccentricity=1.2, angle radius=.5cm]
    {angle=D--C--B};
\end{tikzpicture}

\end{document}

在此处输入图片描述

我怎样才能完成它?

角C不等于50度,画出来的角怎么符合实际?

答案1

您可以使用极坐标来放置BD,这样您就可以将点指定为(<angle>:<distance>)。这确保角度为<angle>。我还会将三角形绘制为封闭路径,而不是使用开放路径。这将使路径末端的连接无缝,只需使用代替-- cycle最后的即可-- (C)。为了避免两次绘制路径,edge可以使用从来B创建箭头。

\documentclass{standalone}
\usepackage{tikz}
\usepackage{siunitx}
\usetikzlibrary{quotes}
\usetikzlibrary{angles}
\usetikzlibrary{decorations.markings}
\usetikzlibrary{calc}

\begin{document}

\begin{tikzpicture}
  [line cap=round,
    decoration={markings,
      mark=at position 0.2 with {%
        \draw [line width=1pt] (-1pt,4pt) -- (-1pt,-4pt) (1pt,4pt) -- (1pt,-4pt);
      },
      mark=at position 0.4 with {%
        \draw [line width=1pt] (-1pt,4pt) -- (-1pt,-4pt) (1pt,4pt) -- (1pt,-4pt);
      },
    },
  ]
  \path [draw, line width=2pt,postaction=decorate] (0,0) coordinate [label={[inner sep=5pt]left:{$C$}}] (C) -- ++(50:5) coordinate [label={[inner sep=5pt]left:{$B$}}] (B) edge [->]  coordinate (E) ($(C)!1.3!(B)$) -- ++(-50:5) coordinate [label={[inner sep=5pt]right:{$D$}}] (D) -- cycle;
  \pic[inner sep=2pt, right, "$\ang{50}$", draw=black, -, angle eccentricity=1.2, angle radius=.5cm]
    {angle=D--C--B};
  \pic[inner sep=2pt, right, "$Z$", draw=black, -, angle eccentricity=1.2, angle radius=.5cm]
    {angle=D--B--E};
\end{tikzpicture}

\end{document}

使用极坐标指定的两个点、一条闭合路径和一条边绘制的三角形

答案2

随附包装tkz-euclide

\documentclass[border=5mm]{standalone}
\usepackage{tkz-euclide}
\begin{document}
\begin{tikzpicture}
    \tkzDefPoint(0,0){C}
    \tkzDefPoint(5,0){D}
    \tkzDefTriangle[two angles = 50 and 50](C,D)
    \tkzGetPoint{B}
    \tkzDrawPoints(C,D,B)
    \tkzLabelPoints(C,D)
    \tkzLabelPoints[above](B)
    \tkzDrawPolygon(C,D,B)
    \tkzMarkSegments[mark=||,size=6pt](C,B D,B)
    \tkzMarkAngle(D,C,B)
    \tkzLabelAngle[pos=1.4](D,C,B){$50^\circ$}
    \tkzDefBarycentricPoint(C=1,B=-4)
    \tkzGetPoint{Bp}
    \tkzMarkAngle(D,B,Bp)
    \tkzLabelAngle[pos=1.4](D,B,Bp){$Z$}
    %\tkzDrawPoint(Bp)
    \draw[->](C)--(Bp);
\end{tikzpicture}
\end{document}

在此处输入图片描述

相关内容