有人能帮忙画一下这个圆圈吗?我已经开始使用如下所示的代码,但我无法得到我所需要的。
\documentclass[12pt,a4paper,oneside]{article}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\draw (0,0) node[circle,draw,inner sep=1pt,label=below:$0$](z0) {}
circle (pi);
\draw[-stealth] (z0) -- (45:pi) node[midway,above]{$x$};
\draw[-stealth] (z0) -- (45:pi) node[left,right]{$z$};
\draw[-stealth] (z0) -- (0:pi) node[midway,below]{$\cos \theta$};
\draw[-stealth] (z0) -- (0:pi) node[left,right]{$1$};
\draw[-stealth] (z0) -- (90:pi) node[left,above]{$i$};
\draw[-stealth] (z0) -- (90:pi) node[left,above]{$i$};
\end{tikzpicture}
\end{document}
我想要得到这样的东西:
答案1
一种可能性是使用angles
andquotes
库。我还删除了不必要的路径重复。
\documentclass[12pt,a4paper,oneside]{article}
\usepackage{tikz}
\usetikzlibrary{angles,quotes}
\begin{document}
\begin{tikzpicture}
\draw (-4,0) -- (4,0) (0,-4) -- (0,4);
\draw (0,0) coordinate(O) node[circle,draw,inner sep=1pt,label=below left:$0$](z0) {}
circle (pi);
\draw[-stealth] (O) -- node[midway,above]{$x$} (45:pi) coordinate(z)
node[pos=1.1]{$z$};
\path (0:pi) coordinate(x) node[below right]{$1$};
\draw (O) -- ({pi*cos(45)},0) node[midway,below]{$\cos \theta$}
-- (45:pi) node[midway,above,rotate=-90]{$\sin \theta$};
\draw (O) -- (90:pi) node[above left]{$i$};
\pic ["$\theta$", draw, angle eccentricity=0.6,angle radius=1.2cm] {angle=x--O--z};
\end{tikzpicture}
\end{document}
答案2
可能的答案的一种变体......这里的库quotes
也用于边缘标签,圆圈由以下方式绘制circle
:
\documentclass[12pt,a4paper,oneside]{article}
\usepackage{tikz}
\usetikzlibrary{angles, arrows.meta,
quotes}
\begin{document}
\begin{tikzpicture}[auto=right]
\draw (0,0) coordinate[label=225:0] (O) circle[radius=pi];
\draw (-4,0) -- (4,0)
(0,-4) -- (0,4);
\draw[thick,-{Triangle[angle=45:2pt 3]}]
(0,0) to[sloped,"$\mathbf{x}$" ']
(45:pi) coordinate[label=45:$z$] (z);
\draw[semithick]
(0,0) to["$\cos\theta$"] (0,0 -| z) coordinate (x)
(x -| z) to[sloped, "$\sin\theta$"] (z);
\node[below right] at (pi,0) {1};
\node[above left] at (0,pi) {$i$};
%
\pic ["$\theta$", draw, angle eccentricity=0.8,angle radius=1 cm] {angle=x--O--z};
\end{tikzpicture}
\end{document}