{
\documentclass{article}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\draw (0,0) circle(2);
\foreach \i in {0, 45, 90, 135, 180, 225, 270, 315} {
\coordinate (A\i) at (\i:2); % 定义点的位置
\draw[fill] (A\i) circle (2pt); % 画点
}
\foreach \i in {0, 45, 90, 135, 180, 225, 270, 315} {
\pgfmathsetmacro{\next}{\i+45}
\ifnum\next=360 \pgfmathsetmacro{\next}{0} \fi
\draw[->] (A\i) -- (A\next);
}
\end{tikzpicture}
\end{document}
}
这是我的Latex代码
上面代码报错的原因是缺少int(\i+45)
\documentclass[tikz,border=1cm]{standalone}
\begin{document}
\begin{tikzpicture}
\draw (0,0) circle(2);
\foreach \i in {0,45,...,315}{
\coordinate (A\i) at (\i:2); % 定义点的位置
\draw[fill] (A\i) circle (2pt); % 画点
}
\foreach \i in {0,45,...,315} {
\pgfmathsetmacro{\next}{int(\i+45)}
\ifnum \next=360\relax
\pgfmathsetmacro{\next}{0}
\fi
\draw[->] (A\i) -- (A\next);
}
\end{tikzpicture}
\end{document}
我很想知道这种图的来源,包括它的所在学科,英文名称以及大致含义。
同时你这个图可拓展性较差,下面的实现也很不优雅,我没有兴趣封装成接口。
另外为了论坛问题的neat
,请你删除这一无效问题,想要修改问题可以使用补充问题功能,而不是重新开一个新的问题。
下面是en画的实现过程...
\documentclass[tikz,border=8pt]{standalone}
\usetikzlibrary{arrows.meta,decorations.markings}
\begin{document}
\begin{tikzpicture}[cap = round]
% \draw (0,0) circle(2);
\foreach \i in {30,60,...,150,240,270,300}{
\node[circle,draw,inner sep=1pt,outer sep=0pt,minimum size=2pt] (A\i) at (\i:2) {}; % 画点
}
\foreach \i in {30,60,...,120,240,270} {
\pgfmathsetmacro{\next}{int(\i+30)}
\path[->] (A\i) edge[bend right=8] (A\next);
}
\foreach \angle/\txt in {30/2,60/1,90/0,120/n-1,150/n-2}{
\node[label={[anchor=\angle+180,outer sep=1pt,inner sep=1.5pt,]\scriptsize$\txt$}] at (\angle:2) {};
}
\foreach \i in {180,210,330,0}{
\node[circle,inner sep=0pt,outer sep=0pt,minimum size=0pt] (A\i) at (\i:2) {}; % 画点
}
\foreach \i in {150,210,300,0} {
\pgfmathsetmacro{\next}{int(\i+30)}
\ifnum \next=360 \pgfmathsetmacro{\next}{0} \fi
\path[->] (A\i) edge[bend right=10] (A\next);
}
\path[dotted] (A180) edge[bend right=10] (A210)
(A330) edge[bend right=10] (A0);
\end{tikzpicture}
\end{document}
其实要想优雅一点,可以用rotate
把整个路径划分为:
不过个人觉得意义不是很大。
我用 Asymptote 来凑个热闹,锻炼下解决问题的能力,也给社区留个解决方案的选择,效果如图:
Asymptote 代码如下
settings.outformat="pdf";
size(200);
path bigCirc = scale(10.)*unitcircle;
path smallCirc[];
pair intersectPs[];
// draw small circles and store coordinates for drawing arrows
for (int i = 0; i < 12; ++i){
smallCirc[i] = shift(10*dir(30*i))*scale(.25)*unitcircle;
// store intersection coordinates in array intersectPs
intersectPs.append(intersectionpoints(bigCirc,smallCirc[i]));
if (i == 0 || i == 6 || i == 7 || i == 11) {
continue; // skip 4 small circles
}
else {
draw(smallCirc[i]);
}
}
// draw arrows and dotted line
for (int i = 0; i < 11; ++i){
if (i == 6){
continue;
} else {
real angStart = degrees(intersectPs[2i+1]),
angEnd = degrees(intersectPs[2i+2]);
draw(arc((0,0),10,angStart,angEnd,CCW),EndArcArrow(TeXHead,2.));
}
}
draw(arc((0,0),10,degrees(intersectPs[12]),degrees(intersectPs[15]),CCW),Dotted);
draw(arc((0,0),10,degrees(intersectPs[22]),degrees(intersectPs[1]),CCW),Dotted);
// label
label("$n-1$",10.5*dir(120),NW);
label("$n-2$",10.5*dir(150),NW);
label("$0$",10.5*dir(90),N);
label("$1$",10.5*dir(60),NE);
label("$2$",10.5*dir(30),NE);
\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{calc}
\begin{document}
\begin{tikzpicture}
% 所有节点、节点标签和循环
\foreach \ang\lab\anch in {90/0/270, 60/1/240, 30/2/210, 120/n-1/300, 150/n-2/330, 240/{}/240, 270/{}/270, 300/{}/300}{
\draw ($(0,0)+(\ang:3)$) circle (2pt);
\node[anchor=\anch] at ($(0,0)+(\ang:3.2)$) {$\lab$};
}
% 圆的顶部,不同节点之间的箭头及其标签
\foreach \ang in {90, 60, 30, 120, 150, 180, 240, 270, 300, 330}{\draw[<-,shorten <=2pt, shorten >=2pt] ($(0,0)+(\ang:3)$) arc (\ang:\ang-30:3);}
% 省略号
\foreach \ang in {180,185,190,195,200,205,210,330,335,340,345,350,355,360}{\draw[fill=black] ($(0,0)+(\ang:3)$) circle (.2pt);}
\end{tikzpicture}
\end{document}
类似可以做
\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{calc}
\begin{document}
\begin{tikzpicture}
% 所有节点、节点标签和循环
\foreach \ang\lab\anch in {90/1/north, 45/2/{north east}, 0/3/east, 270/i/south, 180/{n-1}/west, 135/n/{north west}}{
\draw[fill=black] ($(0,0)+(\ang:3)$) circle (.08);
\node[anchor=\anch] at ($(0,0)+(\ang:2.8)$) {$\lab$};
\draw[->,shorten <=7pt, shorten >=7pt] ($(0,0)+(\ang:3)$).. controls +(\ang+40:1.5) and +(\ang-40:1.5) .. ($(0,0)+(\ang:3)$);
}
% 圆的顶部,不同节点之间的箭头及其标签
\foreach \ang\lab in {90/1,45/2,180/{n-1},135/n}{
\draw[->,shorten <=7pt, shorten >=7pt] ($(0,0)+(\ang:3)$) arc (\ang:\ang-45:3);
\node at ($(0,0)+(\ang-22.5:3.5)$) {$\alpha_{\lab}$};
}
% 圆的底部,不同节点之间的箭头及其标签
\draw[->,shorten <=7pt] ($(0,0)+(0:3)$) arc (360:325:3);
\draw[->,shorten >=7pt] ($(0,0)+(305:3)$) arc (305:270:3);
\draw[->,shorten <=7pt] ($(0,0)+(270:3)$) arc (270:235:3);
\draw[->,shorten >=7pt] ($(0,0)+(215:3)$) arc (215:180:3);
\node at ($(0,0)+(0-20:3.5)$) {$\alpha_3$};
\node at ($(0,0)+(315-25:3.5)$) {$\alpha_{i-1}$};
\node at ($(0,0)+(270-20:3.5)$) {$\alpha_i$};
\node at ($(0,0)+(225-25:3.5)$) {$\alpha_{n-2}$};
% 省略号
\foreach \ang in {310,315,320,220,225,230}{\draw[fill=black] ($(0,0)+(\ang:3)$) circle (.02);}
\end{tikzpicture}
\end{document}
资料来自 山形邦夫的「弗罗贝尼乌斯代数」 第一卷
谢谢您
这种图来源于代数表示论,在非交换代数和表示论中, 箭图 Q 的箭图表示给 Q 的每个顶点赋予一个向量空间, 给每个箭头赋予一个相应向量空间之间的线性映射.简称 quiver 表示