在 tikzpicture 中绘制一个小圆弧来表示一个角度

在 tikzpicture 中绘制一个小圆弧来表示一个角度

您将如何修改以下代码以便我插入图中蓝线指示的圆弧?在正常的 tikzpicture 环境中,这似乎非常简单,但对于图形,我不确定。

谢谢

\documentclass[]{article}
\usepackage[margin=0.5in]{geometry}
\usepackage{pgfplots}
\renewcommand{\thesection}{\arabic{section}}
\usepackage{mathtools}
\usepackage{cancel}
\usepackage{pgfplots}
\usepackage{amsmath}
\newtheorem{theorem}{THEOREM}
\newtheorem{proof}{PROOF}
\usepackage{tikz}
\usepackage{amssymb}
\usetikzlibrary{patterns}
\usepackage{fancyhdr}
\usepackage{bigints}
\usepackage{color}
\usepackage{tcolorbox}
\usepackage{color,xcolor}
\usepackage{booktabs,array}
\usepackage{hyperref}
\usepackage{graphicx}
\usetikzlibrary{arrows}
\usepackage{polynom}
\usepackage{wallpaper}
\usetikzlibrary{shapes.geometric}
\usepgfplotslibrary{fillbetween}
\newenvironment{tightcenter}{
\setlength\topsep{0pt}
\setlength\parskip{0pt}
\begin{center}}{\end{center}}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
axis x line=middle,    % put the x axis in the middle
axis y line=middle,    % put the y axis in the middle
axis line style=thick,
axis line style={->}, % arrows on the axis
xlabel={$x$},          % default put x on x-axis
ylabel={$y$},          % default put y on y-axis
ticks=none,
xmin=-7,xmax=7,
ymin=-7,ymax=7,
clip=false
]
%
\draw[black,thick](axis cs:0,0) circle (1.7cm);
%
%
\node [above] at (axis cs: +0.4,0){$O$};
\node [left,scale=0.9] at (axis cs:  -0.5,-0.4){$\theta$};
%
\node [left,scale=0.9] at (axis cs: -2.4,-3.4){$(x,y)$};
%\node [left] at (axis cs: 0,+1.5){$1$};
%\node [left] at (axis cs: 0,-5.5){$-5$};
\draw[black,thick](axis cs:0,0) -- (axis cs:-2.4,0) -- (axis cs:-2.4,-2.95) --cycle;
\draw[black,thick](axis cs:-2.4,0) rectangle (axis cs:-2,-0.4);
\draw[fill=black](axis cs:-2.4,-2.97) circle (0.4mm);
%
\draw [thick](axis cs:0.92,2) ++(0:1) arc (185:264:0.5);
%\draw [thick](axis cs:2.18,0) ++(0:1) arc (0:95:0.5);
\end{axis}
\end{tikzpicture}
\end{document}

期望输出

答案1

抱歉,我的评论打错了,应该是\draw [thick](axis cs:-0.5,0) arc (180:222:0.5);,也就是说,0少了一个。这是使用该库的版本angles

\documentclass[]{article}
\usepackage[margin=0.5in]{geometry}
\usepackage{pgfplots}
\pgfplotsset{compat=1.16}
\usetikzlibrary{angles,quotes}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
axis x line=middle,    % put the x axis in the middle
axis y line=middle,    % put the y axis in the middle
axis line style=thick,
axis line style={->}, % arrows on the axis
xlabel={$x$},          % default put x on x-axis
ylabel={$y$},          % default put y on y-axis
ticks=none,
xmin=-7,xmax=7,
ymin=-7,ymax=7,
clip=false
]
%
\draw[black,thick](0,0) coordinate (O) circle (1.7cm);
%
%
\node [above] at ( +0.4,0){$O$};
%
\node [left,scale=0.9] at ( -2.4,-3.4){$(x,y)$};
%\node [left] at ( 0,+1.5){$1$};
%\node [left] at ( 0,-5.5){$-5$};
\draw[black,thick](0,0) -- (-2.4,0) coordinate (X) --
 (-2.4,-2.95) coordinate (xy)  --cycle;
\draw[black,thick](-2.4,0) rectangle (-2,-0.4);
\draw[fill=black](-2.4,-2.97) circle (0.4mm);
%
\draw [thick](0.92,2) ++(0:1) arc (185:264:0.5);
%\draw [thick](2.18,0) ++(0:1) arc (0:95:0.5);
\path pic [draw,angle radius=0.5cm,"{$\theta$}",angle eccentricity=1.5] {angle =
X--O--xy};
\end{axis}
\end{tikzpicture}
\end{document}

在此处输入图片描述

相关内容