Tikz 图片弧形问题

Tikz 图片弧形问题

我正在尝试重新创建所附图像,但无法在圆上绘制红色弧形箭头。我尝试过弧形、剪辑等,但无法解决。 在此处输入图片描述

这是我目前想到的办法。

\documentclass{exam}
\usepackage{pgfplots}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{tikz}
\pgfplotsset{compat=newest}
\usepackage{amssymb}
\usetikzlibrary{arrows.meta}



\begin{document}

\begin{tikzpicture}
    \begin{scope}[shift={(2.5,7)}]
\draw[Triangle-Triangle] (-2,0)--(2,0);
\draw[Triangle-Triangle] (0,-2)--(0,2);
\draw[thick,blue] (0,0) circle (1cm);
\node[below] at (2,0){$x$};
\node[below right] at (1,0){\footnotesize{1}};
\node[above left] at (0,1.5){$y$};
\node[below right] at (0,0){\(O\)};
\node[above] at (1,1){\footnotesize{\(y=x\)}};
\filldraw[orange] (.707,.707) circle (1pt);
\filldraw[black] (1,0) circle (1pt);
\node [right] at (.71,.71){\footnotesize{\(P\big(\frac{\sqrt{2}}{2},\frac{\sqrt{2}}{2}\big)\)}};
\draw[thick,orange](-1,-1)--(1,1);
\draw[red] arc (0:45:1);
\end{scope}
\end{tikzpicture}



\end{document}

答案1

你几乎已经成功了。你只需要告诉 TiZ 从哪里开始arc。因此,您基本上需要更改\draw arc (0:45:1);\draw (0:1) arc (0:45:1);

\documentclass[border=10mm]{standalone}
\usepackage{tikz}
\usetikzlibrary{arrows.meta}

\begin{document}

\begin{tikzpicture}
    \draw[Triangle-Triangle] (-2,0)--(2,0);
    \draw[Triangle-Triangle] (0,-2)--(0,2);
    \draw[thick,blue] (0,0) circle (1cm);
    \node[below] at (2,0){$x$};
    \node[below right] at (1,0){\footnotesize{1}};
    \node[above left] at (0,1.5){$y$};
    \node[below right] at (0,0){\(O\)};
    \node[above] at (1,1){\footnotesize{\(y=x\)}};
    \filldraw[orange] (.707,.707) circle (1pt);
    \filldraw[black] (1,0) circle (1pt);
    \node [right] at (.71,.71){\footnotesize{\(P\big(\frac{\sqrt{2}}{2},\frac{\sqrt{2}}{2}\big)\)}};
    \draw[thick,orange](-1,-1)--(1,1);
    \draw[thick,red] (0:1) arc (0:45:1);
\end{tikzpicture}

\end{document}

在此处输入图片描述

如果您想在 中添加箭头arc,我建议您添加库bending,这将帮助您很好地调整箭头,以便底层路径不会扭曲。如果您想在红线(或箭头)上附加标签,您可能需要稍微移动标签。

最后,请注意,还有另一种可能更可取的方法来arc使用选项定义路径。然后,您arc (0:45:1)可以这样写而不是arc[start angle=0, end angle=45, radius=1]。对于 也一样circle:在这里,您可以这样写circle[radius=1pt]而不是circle (1pt)

\documentclass[border=10mm]{standalone}
\usepackage{tikz}
\usetikzlibrary{arrows.meta, bending}

\begin{document}

\begin{tikzpicture}
    \draw[Triangle-Triangle] (-2,0)--(2,0);
    \draw[Triangle-Triangle] (0,-2)--(0,2);
    \draw[thick,blue] (0,0) circle[radius=1];
    \node[below] at (2,0){$x$};
    \node[below right] at (1,0){\footnotesize{1}};
    \node[above left] at (0,1.5){$y$};
    \node[below right] at (0,0){\(O\)};
    \node[above] at (1,1){\footnotesize{\(y=x\)}};
    \filldraw[orange] (.707,.707) circle[radius=1pt];
    \filldraw[black] (1,0) circle[radius=1pt];
    \node[right=5pt] at (.71,.71){\footnotesize{\(P\big(\frac{\sqrt{2}}{2},\frac{\sqrt{2}}{2}\big)\)}};
    \draw[thick,orange](-1,-1)--(1,1);
    \draw[thick,red,-Triangle] (0:1) arc[start angle=0, end angle=45, radius=1] node[pos=.4,right] {$t = \frac{\pi}{4}$};
\end{tikzpicture}

\end{document}

在此处输入图片描述

相关内容