Tikz 如何以简单的方式绘制角度

Tikz 如何以简单的方式绘制角度

我想知道一种简单且通用的绘制角度的方法!

\begin{tikzpicture}
    \coordinate (a) (0,0);
    \coordinate (b) (6,0);
    \coordinate (c) (2,2);
    \draw [->][thick] (0,0)--(6,0) node [pos=0.5, below] {\(\textbf{b}\)} (6,0)--(2,2) node [pos=0.5, above right] {\(\textbf{a}-\textbf{b}\)} (0,0)--(2,2) node [pos=0.5, above left] {\(\textbf{a}\)};
\end{tikzpicture}

像这样

在此处输入图片描述

答案1

所以适合您的代码的代码提供:

\documentclass{article}

\usepackage{tkz-euclide}

\begin{document}


\begin{tikzpicture}[scale=1.25]%,cap=round,>=latex]

\coordinate [label=left:$A$] (A) at (0cm,0cm);
\coordinate [label=right:$C$] (C) at (6cm,0cm);
\coordinate [label=above:$B$] (B) at (2cm,2cm);

\draw [->][thick] (A)--(B) node [pos=0.5, above] {\(\textbf{a}\)} (B)--(C) node [pos=0.5, above right] {\(\textbf{a}-\textbf{b}\)} (A)--(C) node [pos=0.5, below] {\(\textbf{b}\)};

\tkzMarkAngle[fill= orange,size=0.8cm,opacity=.4, mark=none](C,A,B)
\tkzLabelAngle[pos = 0.6](C,A,B){$\alpha$}

\end{tikzpicture}

在此处输入图片描述

带箭头:

\documentclass{article}

\usepackage{tkz-euclide}

\begin{document}
    
    
    \begin{tikzpicture}[scale=1.25]%,cap=round,>=latex]
        
        \coordinate [label=left:$A$] (A) at (0cm,0cm);
        \coordinate [label=right:$C$] (C) at (6cm,0cm);
        \coordinate [label=above:$B$] (B) at (2cm,2cm);
        
        \path[-stealth]
        (A) edge node[above left] {$a$} +(B)
        ++(A) edge node[below] {$b$} +(C)
        ++(C)   edge node[above right] {$a-b$} +(-4,2);
        
        \tkzMarkAngle[fill= orange,size=0.8cm,opacity=.4, mark=none](C,A,B)
        \tkzLabelAngle[pos = 0.6](C,A,B){$\alpha$}
        
    \end{tikzpicture}
\end{document}

在此处输入图片描述

答案2

如同纯粹的 tikz图片`...

\documentclass[border=3.141592]{standalone}
\usepackage{bm}
\usepackage{tikz}
\usetikzlibrary{angles, arrows.meta,
                quotes}
                

\begin{document}
    \begin{tikzpicture}[
        > = {Straight Barb},
arr/.style = {-Stealth, semithick}
                        ]
\coordinate (A) at (0,0);
\coordinate (B) at (6,0);
\coordinate (C) at (2,2);

\draw[arr] (A) to ["$\bm{a}$"] (C);
\draw[arr] (A) to ["$\bm{b}$" '] (B);
\draw[arr] (B) to ["$\bm{a}-\bm{b}$" '] (C);

\pic[draw, <->,
     angle radius = 11mm,
     "$\alpha$"] {angle = B--A--C};
    \end{tikzpicture}
\end{document}

在此处输入图片描述

相关内容