如何使用 tikzpicture 图形模式绘制角度曲线

如何使用 tikzpicture 图形模式绘制角度曲线

您能帮我画出如何用浅蓝色绘制曲线来表示角度吗?

\documentclass[]{article}
\usepackage[margin=0.5in]{geometry}
\usepackage{mathtools}
\usepackage{cancel}
\usepackage{pgfplots}
\newenvironment{tightcenter}{
\setlength\topsep{0pt}
\setlength\parskip{0pt}
\begin{center}}{\end{center}}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
axis line style=thick,
axis lines=middle,
grid=none,
%
every x tick/.style={black},
every y tick/.style={black},
%
%grid style={line width=.1pt, draw=black!40},
major grid style={line width=.2pt,draw=black!50},
%
xmin=-3.3,
xmax=+3.3,
ymin=-3.3,
ymax=+3.3,
height=8cm,
width=8cm,
%label style={font=\normalsize},
xlabel=\large $x$,
ylabel=\large $y$,
%xtick={-10,-9,-8,-7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7,8,9,10},
%ytick={-10,-9,-8,-7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7,8,9,10},
%xtick={-3,-2,-1,0,1,2,3},
%ytick={-3,-2,-1,0,1,2,3},
ticks=none,
clip=false,
%every tick label/.append style={font=\tiny},
ylabel style={
anchor=south,
at={(ticklabel* cs:1.0)},
yshift=1pt
},
xlabel style={
anchor=west,
at={(ticklabel* cs:1.0)},
xshift=1pt
},
yticklabel style={
fill=white,
},
xticklabel style={
fill=white
}
]
\draw[fill=gray!30] (axis cs:0,0) -- (axis cs:-2.5,0)--(axis cs:0,-2.5)--cycle;
\draw[thick] (axis cs:0,0) rectangle (axis cs:-0.3,-0.3);
%
\draw[thick,red](axis cs:0.17,0.85) ++(0:1) arc (195:320:2);
%
%
\node[above] at (axis cs:0.25,0) {\large $O$};
%
\addplot[thick,samples=100,domain=-3.2:0.5] {-x-2.5};
%
\node[left] at (axis cs:-0.1,-2.6) {\large $-2$};
\node[below] at (axis cs:-2.7,-0.1) {\large $-3$};
\end{axis}
\newline
\end{tikzpicture}
\end{document}

太感谢了

答案1

添加行

\draw[thick,blue] (330,145) arc (90:145:50);

到你的 TikZ 图形。你将得到以下内容:

在此处输入图片描述

答案2

我不明白为什么你需要/想要使用这些axis属性来制作这张图片,所以我不得不提出一个更简单的答案,使用angles,quotes库。有了这个解决方案,你不需要自己进行任何计算,只需放置节点并绘制它们之间的角度即可。

您也可以使用该tkz-euclide库来执行此操作。

轴的角度

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

\begin{document}
    \begin{tikzpicture}
        \coordinate (O) at (0,0);
        \coordinate (A) at (0,-2);
        \coordinate (B) at (-3,0);
        
        \fill[gray!50] (A) -- (O) -- (B) -- cycle;
        
        \draw pic[draw,blue,fill=blue!30,angle radius=0.75cm,"$\theta$" shift={(-2mm,4mm)}] {angle=O--A--B};
        
        \draw ($(A)!-0.2!(B)$) -- ($(B)!-0.2!(A)$);
        \draw[->] (-4,0) -- (4,0) node[right] {$x$};
        \draw[->] (0,-4) -- (0,4) node[above] {$y$};
        \draw (-.2,0)|-(0,-.2);
        
        \node[above] at (B) {$-3$};
        \node[below left] at (A) {$-2$};
        \node[above right] at (O) {$O$};
        
    \end{tikzpicture}
\end{document}

请注意,您可以更改角度属性(如果您不想填充它等)

相关内容