我想在笛卡尔平面上画一个以原点为中心的单位圆。原点用一个点标记,并标记为“O”,圆上画五个点,一个在 x 轴上,其余的点在正 x 轴的k(2\pi/5)
弧度处,每个整数1 \leq k < 5
,标记为“ w_{k}
”。还要从原点向每个 画箭头w_{k}
。要画一个角度并标记 - 从正 x 轴到通过 的射线的角度w_{1}
。
我已包含部分代码。它以以下命令启动。
\tikzset{mydot/.style={fill,circle,inner sep=1.5pt}}
有没有手册解释这些命令?我猜这是在指导 LaTeX 如何使\mydot
代码中每次出现“ ”时都显示表示坐标的点。
\documentclass{amsart}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{amsthm}
\usepackage{newlfont}
\usepackage{mathtools}
\usepackage{tikz}
\tikzset{
mydot/.style={
fill,
circle,
inner sep=1.5pt
}
}
\begin{document}
\begin{tikzpicture}[>=latex]
% the coordinates of the vertices
\coordinate (O) at (0,0);
\coordinate (w_{1}) at (\cos(2\pi/5), \sin(2\pi/5));
% the axes
\draw[help lines,->] (-1.5,0) -- (1.5,0);
\draw[help lines,->] (0,-1.5) -- (0,1.5);
% labelling the vertices
\node[mydot,label={below:$O$}] at (O) {};
\node[mydot,label={right:$w_{1} = \bigl(\cos(2\pi/5), \sin(2\pi/5)\bigr)$}] at (w_{1}) {};
% the arcs for the angle
\begin{scope}[gray]
\draw[->]
(1,0) +(0:0.5cm) arc [radius=1cm,start angle=0,end angle=2\pi/5] node[midway,right] {$2\pi/5$};
\end{scope}
\end{tikzpicture}
\end{document}
答案1
要了解有关 TikZ 的更多信息,请阅读手册.pdf。通过宏,\n
您可以调整要采取的根的顺序。
\documentclass[tikz]{standalone}
\usepackage{amsmath}% for \Re and \Im
\def\n{5}
\begin{document}
\begin{tikzpicture}[
dot/.style={draw,fill,circle,inner sep=1pt}
]
\draw[->] (-2,0) -- (2,0) node[below] {$\Re$};
\draw[->] (0,-2) -- (0,2) node[left] {$\Im$};
\draw[help lines] (0,0) circle (1);
\node[dot,label={below right:$O$}] (O) at (0,0) {};
\foreach \i in {1,...,\n} {
\node[dot,label={\i*360/\n-(\i==\n)*45:$w_{\i}$}] (w\i) at (\i*360/\n:1) {};
\draw[->] (O) -- (w\i);
}
\draw[->] (0:.3) arc (0:360/\n:.3);
\node at (360/\n/2:.5) {$\alpha$};
\end{tikzpicture}
\end{document}
为了1 < n < 13
:
答案2
只是为了和 PSTricks 一起玩。
\documentclass[pstricks,border=24pt,12pt]{standalone}
\usepackage{pst-node,pst-plot}
\def\Object#1{%
\begin{pspicture}[saveNodeCoors,arrows=->](-2,-2)(2,2)
\pscircle{2}
\curvepnodes[plotpoints=\numexpr#1+1]{0}{360}{2 t PtoC}{w}
\multido{\i=0+1}{\wnodecount}{\psline(w\i)\uput[!N-w\i.y N-w\i.x atan](w\i){$w_{\i}$}}
\end{pspicture}}
\begin{document}
\foreach \n in{1,2,...,10}{\Object{\n}}
\end{document}
答案3
加上一些附加注释
\documentclass[tikz]{standalone}
\usepackage{amsmath}% for \Re and \Im
\def\n{8}
\begin{document}
\begin{tikzpicture}[
dot/.style={draw,fill,circle,inner sep=1pt}
]
\draw[->] (-2,0) -- (2,0) node[below] {$\Re$};
\draw[->] (0,-2) -- (0,2) node[left] {$\Im$};
\draw[help lines] (0,0) circle (1);
\node[dot] (O) at (0,0) {};
\node[label={above right:$+i$}] (I1) at (0,1) {};
\node[label={below right:$-i$}] (I2) at (0,-1) {};
\node[label={above right:$1$}] (U1) at (1,0) {};
\node[dot,label={above right:$-1$}] (I2) at (-1,0) {};
\foreach \i in {1,...,\n} {
\node[dot,label={\i*360/\n-(\i==\n)*45:$w_{\i}$}] (w\i) at ( \i*360/\n:1) {};
\draw[->] (O) -- (w\i);
}
\draw[->] (0:.3) arc (0:360/\n:.3);
\node at (360/\n/2:.5) {$\alpha$};
\end{tikzpicture}
\end{document}