如何画三角形的角平分线

如何画三角形的角平分线
\documentclass{book}
\usepackage{tikz,amsmath,amssymb,tkz-euclide}
    \usetkzobj{all}
    \usepackage{color}
\usetikzlibrary{positioning}% To get more advances positioning options
\usetikzlibrary{arrows}% To get more arrow heads
\usepackage{amsthm,color}
\usetikzlibrary{arrows,plotmarks}
\usetikzlibrary{quotes,angles}


\theoremstyle{definition}
\newtheorem{exinn}{Example}[chapter]
\newenvironment{example}
  {\clubpenalty=10000
   \begin{exinn}%
   \mbox{}%
   {\color{blue}\leaders\hrule height .8ex depth \dimexpr-.8ex+0.8pt\relax\hfill}%
   \mbox{}\linebreak\ignorespaces}
  {\par\kern2ex\hrule\end{exinn}}

\begin{document}
\chapter{Chapter One}
\section{Section One}

\begin{tikzpicture}
  \draw[blue, very thick]
    (0,0) coordinate (a) node[black,left] {A}
    -- (2,4) coordinate (b) node[black,above] {B}
    -- (7,0) coordinate (c) node[black,right] {C}
    pic["$\alpha$", draw=orange, -, angle eccentricity=1.2, angle radius=1cm]
    {angle=a--b--c}
        pic["$\beta$", draw=orange, -, angle eccentricity=1.2, angle radius=1cm]
    {angle=c--a--b}
        pic["$\gamma$", draw=orange, -, angle eccentricity=1.2, angle radius=1cm]
    {angle=b--c--a}-- cycle;
\end{tikzpicture}

\end{document}

答案1

xelatex使用或使用auto-pst-pdf包运行pdflatex

\documentclass{book}
\usepackage{pst-eucl}

\begin{document}
\begin{pspicture}[showgrid=false](-1,-1)(7.5,5)
\pstGeonode[PointSymbol=none,PosAngle={180,90,0}](0,0){A}(2,4){B}(7,0){C}
\pspolygon[linecolor=blue,linewidth=1pt](A)(B)(C)
\pstMarkAngle[linecolor=red,MarkAngleRadius=0.8]{C}{A}{B}{$\alpha$}
\pstMarkAngle[linecolor=red,MarkAngleRadius=0.8]{A}{B}{C}{$\beta$}
\pstMarkAngle[linecolor=red,MarkAngleRadius=0.8]{B}{C}{A}{$\gamma$}
\pstBissectBAC[linestyle=none,PointSymbol=none,PointName=none]{C}{A}{B}{A'}
\pstBissectBAC[linestyle=none,PointSymbol=none,PointName=none]{A}{B}{C}{B'}
\pstBissectBAC[linestyle=none,PointSymbol=none,PointName=none]{B}{C}{A}{C'}
\pstInterLL[PointName=none]{A}{B}{C}{C'}{AB}\psline[linestyle=dashed](C)(AB)
\pstInterLL[PointName=none]{B}{C}{A}{A'}{BC}\psline[linestyle=dashed](A)(BC)
\pstInterLL[PointName=none]{C}{A}{B}{B'}{CA}\psline[linestyle=dashed](B)(CA)
\rput(A){\psline[linecolor=red](0.8;{(A')})}
\rput(B){\psline[linecolor=red](0.8;{(B')})}
\rput(C){\psline[linecolor=red](0.8;{(C')})}
\end{pspicture}    

\end{document}

在此处输入图片描述

答案2

无论如何,由于您正在加载tkz-euclide,因此您可以简单地使用它。我利用了tkz-euclide已定义内心的事实,在第 32 页上会有一个更短的代码,但在那里线条会超出范围。我正在使用Ulrike Fischer 的回答,它使用了一种有时被认为已弃用的语法,但对于这种线的交叉来说,它工作得很好。

\documentclass[tikz,border=3.14mm]{standalone}
\usepackage{tkz-euclide}
\usetkzobj{all}
\usetikzlibrary{quotes,angles}

\begin{document}

\begin{tikzpicture}
  \draw[blue, very thick]
    (0,0) coordinate (a) node[black,left] {A}
    -- (2,4) coordinate (b) node[black,above] {B}
    -- (7,0) coordinate (c) node[black,right] {C}
    pic["$\alpha$", draw=orange, -, angle eccentricity=1.2, angle radius=1cm]
    {angle=a--b--c}
        pic["$\beta$", draw=orange, -, angle eccentricity=1.2, angle radius=1cm]
    {angle=c--a--b}
        pic["$\gamma$", draw=orange, -, angle eccentricity=1.2, angle radius=1cm]
    {angle=b--c--a}-- cycle;
    \tkzInCenter(a,b,c)
    \tkzGetPoint{d}
    \tkzDrawPoint(d)
    \draw[red] (a) -- (d)--(intersection of  a--d and b--c);
    \draw[red] (b) -- (d)--(intersection of  b--d and a--c);
    \draw[red] (c) -- (d)--(intersection of  c--d and b--a);
\end{tikzpicture}
\end{document}

在此处输入图片描述

在此处输入图片描述

这是一个带有宏的版本,其中删除了所有不必要的内容。

\documentclass[tikz,border=3.14mm]{standalone}
\usepackage{tkz-euclide}
\usetkzobj{all}
\usetikzlibrary{quotes,angles}

\newcommand{\DrawBisector}[4][red]{
\tkzFindSlopeAngle(#3,#2)
\let\tmpAngle=\tkzAngleResult
\tkzFindAngle(#2,#3,#4)
\draw[red] (#3) + (\tmpAngle+\tkzAngleResult/2:1) --(#3);
}

\begin{document}

\begin{tikzpicture}
  \draw[blue, very thick]
    (0,0) coordinate (a) node[black,left] {A}
    -- (2,4) coordinate (b) node[black,above] {B}
    -- (7,0) coordinate (c) node[black,right] {C}
    pic["$\alpha$", draw=orange, -, angle eccentricity=1.2, angle radius=1cm]
    {angle=a--b--c}
        pic["$\beta$", draw=orange, -, angle eccentricity=1.2, angle radius=1cm]
    {angle=c--a--b}
        pic["$\gamma$", draw=orange, -, angle eccentricity=1.2, angle radius=1cm]
    {angle=b--c--a}-- cycle;
    \DrawBisector{a}{b}{c}
    \DrawBisector{b}{c}{a}
    \DrawBisector{c}{a}{b}
\end{tikzpicture}
\end{document}

在此处输入图片描述

对于那些既不懂法语又不方便在 tkz-euclide 源代码中查找宏定义的人来说,这里有一个 TiZ“唯一”的解决方案是计算内心,然后绘制角平分线。(内心的确定已由 Mark Wibrow 在这个答案。我所做的或多或少就是将他的 tikzmath 代码转换为使用 calc 库的代码,因为这可以说更容易使用。)

\documentclass[tikz,border=3.14mm]{standalone}
\usetikzlibrary{quotes,angles,calc}

\begin{document}

\begin{tikzpicture}
  \draw[blue, very thick]
    (0,0) coordinate (a) node[black,left] {A} 
    -- (2,4) coordinate (b) node[black,above] {B}
    -- (7,0) coordinate (c) node[black,right] {C}
    pic["$\alpha$", draw=orange, -, angle eccentricity=1.2, angle radius=1cm]
    {angle=a--b--c}
        pic["$\beta$", draw=orange, -, angle eccentricity=1.2, angle radius=1cm]
    {angle=c--a--b}
        pic["$\gamma$", draw=orange, -, angle eccentricity=1.2, angle radius=1cm]
    {angle=b--c--a}-- cycle;
    \path let \p1=(a),\p2=(b),\p3=(c),\n1={veclen(\x2-\x3,\y2-\y3)+veclen(\x1-\x3,\y1-\y3)
    +veclen(\x2-\x1,\y2-\y1)},
    \n2={veclen(\x2-\x3,\y2-\y3)/\n1},
    \n3={veclen(\x1-\x3,\y1-\y3)/\n1},\n4={veclen(\x2-\x1,\y2-\y1)/\n1}
     in coordinate (incenter) at (barycentric cs:a=\n2,b=\n3,c=\n4);
   \fill[red] (incenter) circle (1pt);
   \foreach \X in {a,b,c}
   {\draw[red] (\X) -- ($(\X)!1cm!(incenter)$);}
\end{tikzpicture}
\end{document}

在此处输入图片描述

更新:线条延伸至相对的边缘。

\documentclass[tikz,border=3.14mm]{standalone}
\usetikzlibrary{quotes,angles,calc,intersections}

\begin{document}

\begin{tikzpicture}
  \draw[blue, very thick]
    (0,0) coordinate (a) node[black,left] {A} 
    -- (2,4) coordinate (b) node[black,above] {B}
    -- (7,0) coordinate (c) node[black,right] {C}
    pic["$\alpha$", draw=orange, -, angle eccentricity=1.2, angle radius=1cm]
    {angle=a--b--c}
        pic["$\beta$", draw=orange, -, angle eccentricity=1.2, angle radius=1cm]
    {angle=c--a--b}
        pic["$\gamma$", draw=orange, -, angle eccentricity=1.2, angle radius=1cm]
    {angle=b--c--a} -- cycle;
    \path let \p1=(a),\p2=(b),\p3=(c),\n1={veclen(\x2-\x3,\y2-\y3)+veclen(\x1-\x3,\y1-\y3)
    +veclen(\x2-\x1,\y2-\y1)},
    \n2={veclen(\x2-\x3,\y2-\y3)/\n1},
    \n3={veclen(\x1-\x3,\y1-\y3)/\n1},\n4={veclen(\x2-\x1,\y2-\y1)/\n1}
     in coordinate (incenter) at (barycentric cs:a=\n2,b=\n3,c=\n4);
   \fill[red] (incenter) circle (1pt);
   \path[name path=c] (a) -- (b);
   \path[name path=b] (a) -- (c);
   \path[name path=a] (c) -- (b);
   \foreach \X in {a,b,c}
   {\path[overlay,name path=aux] (\X) -- ($(\X)!12cm!(incenter)$);
   \draw[red,name intersections={of=aux and \X,by=i-\X}] (\X) -- (i-\X); 
   }
\end{tikzpicture}
\end{document}

在此处输入图片描述

答案3

使用 calc 库可以轻松计算线段 BC 的中点。只有当三角形 ABC 是等腰三角形时,连接顶点 A 和 BC 中点的线才是角平分线。但我们可以通过将 ABC 与单位圆在 A 处相交来构成等腰三角形 APQ。如果 M 是 PQ 的中点,则 AM 和 BC 的交点 X 产生角平分线 AX。

\documentclass[tikz]{standalone}
\usetikzlibrary{calc,intersections}
\begin{document}

\begin{tikzpicture}
\coordinate (B) at (0,0);
\coordinate (C) at (7,0);
\coordinate (A) at (1,3);

\draw[name path=triangle]  (A) -- (B) -- (C) -- cycle;
\path[name path=circle] (A)  circle [radius=1pt];
\path [name intersections={of=triangle and circle}];

\coordinate (P) at (intersection-1);
\coordinate (Q) at (intersection-2);
\coordinate (M) at ($.5*(P)+.5*(Q)$);
\coordinate (X) at (intersection of {B--C} and {A--M});

\draw (A) -- (X);

\end{tikzpicture}    
\end{document}

角平分线

答案4

使用tzplot

在此处输入图片描述

\documentclass{standalone} 

\usepackage{tzplot}

\begin{document}

\begin{tikzpicture}[font=\scriptsize]
\tzcoors(0,0)(a){A}[l](2,4)(b){B}(7,0)(c){C}[r];
\tzpolygon[blue,very thick](a)(b)(c);
\tzanglemark(b)(a)(c){$\alpha$}
\tzcoor*[red](tzAAmid)(am)(1.5pt)
\tzanglemark(a)(b)(c){$\beta$}
\tzcoor*[red](tzAAmid)(bm)(1.5pt)
\tzanglemark(a)(c)(b){$\gamma$}
\tzcoor*[red](tzAAmid)(cm)(1.5pt)
\tzline[red]"aa"(a)(intersection of a--am and b--c)
\tzline[red]"bb"(b)(intersection of b--bm and a--c)
\tzline[red]"cc"(c)(intersection of c--cm and a--b)
\tzXpoint*{aa}{bb}(X)
\end{tikzpicture}

\end{document}

相关内容