帮助使用 tikz 在 Latex 中完成图表

帮助使用 tikz 在 Latex 中完成图表

在此处输入图片描述 我想寻求帮助来构建一个图表,我真的需要你的帮助

我的代码:

\documentclass[tikz,border=10pt]{standalone}
\usepackage{tikz}
\usetikzlibrary{angles,quotes}

\begin{document}
    \begin{tikzpicture}[scale=1.5, angle radius=0.5cm]
        
        \coordinate[label=left:A] (A) at (0,0);
        \coordinate[label=right:B] (B) at (4,0);
        \coordinate[label=above:F] (F) at (2.5,2.5);
        \coordinate[label=below:E] (E) at (2,0);

        \draw[thick, red] (A) -- (B);
        \draw[thick] (E) -- (F);
        
        \draw
        pic[draw, fill=yellow!80, angle radius=-0.5cm, "$\alpha$"] {angle=B--E--A}
        pic[draw, fill=green!50, angle radius=0.1cm, "$\beta$"] {angle=B--E--A};
        
    \end{tikzpicture}
\end{document}

答案1

请尝试以下操作:

\documentclass[border=10pt]{standalone}
\usepackage{tikz}
\usetikzlibrary{angles,
                backgrounds,
                quotes}

\begin{document}
    \begin{tikzpicture}[
              > = stealth,
   angle radius = 7mm,
      MA/.style = {draw, fill=#1,
                   angle eccentricity=0.6,
                   font=\large} % angle label position!
                        ]

\draw[thick, red]   (0,  0) coordinate[label= left:A] (A) -- ++ 
                    (4,  0) coordinate[label=right:B] (B);
\draw[thick]        (1.5,0) coordinate  (O) -- ++
                    (1,2.5) coordinate[label=F] (F)
                    (O) -- ++ (-0.4,-1) coordinate[label=below:E];
\scoped[on background layer]
{
\pic [MA=green,  "$\alpha$"]    {angle=F--O--A};
\pic [MA=yellow, "$\beta$"]     {angle=B--O--F};
}
    \end{tikzpicture}
\end{document}

在此处输入图片描述

答案2

tkz-euclide

\documentclass[border=5mm]{standalone}
\usepackage{tkz-euclide}
\begin{document}
\begin{tikzpicture}
    \tkzDefPoints{0/0/A,4/0/B,-0.4/-1/E,2.5/2.5/F}
    \tkzInterLL(A,B)(E,F)\tkzGetPoint{O}
    %
    \tkzFillAngle[draw,fill=yellow!80](F,O,A)
    \tkzLabelAngle[pos = 0.5](F,O,A){$\alpha$}%
    \tkzFillAngle[draw,fill=green!50](B,O,F)
    \tkzLabelAngle[pos = 0.5](B,O,F){$\beta$}%
    %
    \tkzDrawLines[red](A,B)
    \tkzDrawLines(E,F)  
    %
    \tkzDrawPoints(A,B,E,F)  
    \tkzLabelPoints(A,B,E,F) 
\end{tikzpicture}
\end{document}

在此处输入图片描述

相关内容