我有下面提供的代码。该代码生成以下图片:
我想旋转 \ddots(以红色圆圈显示),但不知道如何做到这一点。
代码:
\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{math,calc,trees,positioning,arrows,fit,shapes}
\usetikzlibrary{patterns}
\begin{document}
\begin{tikzpicture}
\tikzmath{\x =1.8; \y =2.4; \d=1;}
\coordinate[label={[below,yshift=-.1cm]$x$}] (Origin) at (0,0) circle (.5ex);
\coordinate [label={[below,xshift=0.1cm]$l_1$}](Lone) at ({\x*cos(0)},{\x*sin(0)});
\coordinate [](Lonelong) at ({\y*cos(0)},{\y*sin(0)});
\coordinate [label={[right]$l_2$}](Ltwo) at ({\x*cos(60)},{\x*sin(60)});
\coordinate [](Ltwolong) at ({\y*cos(60)},{\y*sin(60)});
\coordinate [label={[left]$l_3$}](Lthree) at ({\x*cos(120)},{\x*sin(120)});
\coordinate [](Lthreelong) at ({\y*cos(120)},{\y*sin(120)});
\coordinate [label={[above]$l_i$}](Li) at ({\x*cos(180)},{\x*sin(180)});
\coordinate [](Lilong) at ({\y*cos(180)},{\y*sin(180)});
\coordinate [label={[below,xshift=0.3cm, yshift=0cm]$l_{i+1}$}](Liplusone) at ({\x*cos(240)},{\x*sin(240)});
\coordinate [](Liplusonelong) at ({\y*cos(240)},{\y*sin(240)});
\coordinate [label={[below]$l_n$}] (Ln) at ({\x*cos(300)},{\x*sin(300)});
\coordinate [] (Lnlong) at ({\y*cos(300)},{\y*sin(300)});
\coordinate [label={[above,xshift=.2cm,yshift=-.25cm ]$O_n$}](On) at ({\x*cos(330)},{\x*sin(330)});
\coordinate [label={[below,xshift=-.1cm, yshift=.3cm]$O_i$}](Oi) at ({\x*cos(210)},{\x*sin(210)});
\coordinate [label={[below,xshift=.0cm, yshift=.3cm]$O_2$}](O2) at ({\x*cos(90)},{\x*sin(90)});
\coordinate [label={[below,xshift=.1cm, yshift=.3cm]$O_1$}](O1) at ({\x*cos(30)},{\x*sin(30)});
\coordinate [label={[below,yshift=.4cm]\reflectbox{$\ddots$}}](Dots2) at ({\d*cos(150)},{\d*sin(150)});
\coordinate [label={[below,yshift=.1cm]$\dots$}](Dots3) at ({\d*cos(270)},{\d*sin(270)}); % dots
\draw[dotted,pattern=north west lines,opacity=0.5, pattern color=blue](Origin)--(Lone)--(Ln) -- cycle;
\draw[dotted,pattern=north west lines,opacity=0.5, pattern color=blue](Origin)--(Ltwo)--(Lone) -- cycle;
\draw[dotted,pattern=north west lines,opacity=0.5, pattern color=blue](Origin) -- (Ltwo) -- (Lthree) -- cycle;
\draw[dotted,pattern=north west lines,opacity=0.5, pattern color=blue](Origin) -- (Li) -- (Liplusone) -- cycle;
\draw[-](Origin)--(Lone);
\draw[dashed](Lone)--(Lonelong);
\draw[-](Origin)--(Ltwo);
\draw[dashed](Ltwo)--(Ltwolong);
\draw[-](Origin)--(Lthree);
\draw[dashed](Lthree)--(Lthreelong);
\draw[-](Origin)--(Li);
\draw[dashed](Li)--(Lilong);
\draw[-](Origin)--(Ln);
\draw[dashed](Ln)--(Lnlong);
\draw[-](Origin)--(Liplusone);
\draw[dashed](Liplusone)--(Liplusonelong);
\draw[black,fill=black] (0,0) circle (.5ex);
\end{tikzpicture}
\end{document}
答案1
重复评论:您可以使用旋转键,
\coordinate [label={[below,yshift=.1cm,rotate=60]$\dots$}](Dots2) at ({\d*cos(150)},{\d*sin(150)});
不过,我建议使用循环和其他简化方法。
\documentclass[tikz]{standalone}
\usetikzlibrary{patterns}
\begin{document}
\begin{tikzpicture}
\path[pattern=north west lines,opacity=0.5, pattern color=blue]
(0,0) coordinate (O) -- (-60:2) -- (0:2) -- (60:2) -- (120:2)
-- (O) -- (-120:2) -- (-180:2) -- cycle;
\node[circle,fill,inner sep=2pt,label=below:$x$] at (O){};
\foreach \X in {1,2,3}
{\draw (60*\X-60+180:2) -- (60*\X-60:2) node[anchor={60*\X+180\ifnum\X<3
-120\fi}]{$\ell_\X$};
\draw[dashed] (60*\X-60:2) -- ++(60*\X-60:0.5)
(60*\X-60+180:2) -- ++(60*\X-60+180:0.5);}
\foreach \X [count=\Y] in {\ell_i,\ell_{i+1},\ell_n}
{\path (\Y*60+120:2) node[anchor={-60*\Y\ifnum\Y=2 +120\fi}]{$\X$};}
\path foreach \X [count=\Y] in {O_1,O_2,{},O_i,{},O_n}
{(-30+60*\Y:2.2) node{$\X$}};
\path foreach \X in {150,270} {(\X:1.7) node[rotate=\X-90]{$\dots$}};
\end{tikzpicture}
\end{document}
请注意,这可以进一步优化,并且不同的循环外部和内部路径是为了说明不同的选项。