如何在 Tikz 中不使用圆弧来显示轨道的旋转箭头?

如何在 Tikz 中不使用圆弧来显示轨道的旋转箭头?

我想用蓝色显示天体C2的轨道的旋转方向。

我使用了arc,但这意味着我在已经绘制的 C2 轨道上方绘制了 4 个 C2 轨道部分。因此它显示了带有大量像素的 C2 轨道(这看起来不太好看)。

有没有办法改进我的绘图以显示轨道的旋转方向(无需绘制一堆弧)?

%C2 orbit
\draw [thick] (0,0) circle ({(1-\muu)*\R});


% C2 rotation: 4 arrows
\draw [thick, ->] (C2) arc (0:45:{(1-\muu)*\R});
\draw [thick, ->] (C2) arc (0:45+90:{(1-\muu)*\R});
\draw [thick, ->] (C2) arc (0:45+180:{(1-\muu)*\R});
\draw [thick, ->] (C2) arc (0:45+270:{(1-\muu)*\R});

以下是完整代码:

\begin{tikzpicture}[scale=0.5]

% Variables
\def\muu{0.005}
\def\R{10}


% Coordinates
\coordinate (L1) at ({\R*(1-(\muu/3)^(1/3))},0);
\coordinate (L2) at ({\R*(1+(\muu/3)^(1/3))},0);
\coordinate (L3) at ({-\R*(1+5/12*\muu)},0);
\coordinate (L4) at ({\R*(1/2*(1-2*\muu))},{\R*sqrt(3)/2});
\coordinate (L5) at ({\R*1/2*(1-2*\muu)},{-\R*sqrt(3)/2});
\coordinate (C1) at ({-\muu*\R},0);
\coordinate (C2) at ({(1-\muu)*\R},0);
\coordinate (G) at (0,0);


%C2 orbit
\draw [thick] (0,0) circle ({(1-\muu)*\R});


% C2 rotation: 4 arrows
\draw [thick, ->] (C2) arc (0:45:{(1-\muu)*\R});
\draw [thick, ->] (C2) arc (0:45+90:{(1-\muu)*\R});
\draw [thick, ->] (C2) arc (0:45+180:{(1-\muu)*\R});
\draw [thick, ->] (C2) arc (0:45+270:{(1-\muu)*\R});


% 2 equilateral triangles
\draw [draw=red, dashed, every edge/.append style={draw=red, dashed}]
     (L4) -- node[sloped] {$\parallel$} (C1) 
     (L4) -- node[sloped] {$\parallel$} (C2) 
     (L5) -- node[sloped] {$\parallel$} (C1) 
     (L5) -- node[sloped] {$\parallel$} (C2);
\draw [draw=white, dashed, every edge/.append style={draw=red, dashed}]
     (C1) -- node[sloped] {$\parallel$} (C2);

% Degrees on each angle
\draw ({-\muu*\R+(1-\muu)*\R/5},0) arc (0:-60:{(1-\muu)*\R/5})  node[midway, below right] {\huge $60^\circ$}; %C1
\draw ({(1-\muu)*\R-(1-\muu)*\R/5},0) arc (180:240:{(1-\muu)*\R/5}) node[midway, below left] {\huge $60^\circ$}; %C2
\draw ({\R*1/2*(1-2*\muu)-(1-\muu)*\R/5*1/2},{-\R*sqrt(3)/2+(1-\muu)*\R/5*sqrt(3)/2}) arc (120:60:{(1-\muu)*\R/5}) node[midway, above] {\huge $60^\circ$}; %L5


% Axes
\draw [thick, dashed] ({-(\R*(1+(\muu/3)^(1/3))+1))},0)--({\R*(1+(\muu/3)^(1/3))+1},0); %x axis
\draw [thick, dashed] (0,{-(\R*(1+(\muu/3)^(1/3))+1))})--(0,{\R*(1+(\muu/3)^(1/3))+1}); %y axis



% Celestial bodies
\draw [thick, fill=yellow] (C1) circle (1); %C1
\draw [thick, fill=cyan] (C2) circle (0.25); %C2

% Lagrangian points
\node at (L1) {\color{gray}{\huge$\bullet$}}; %L1
\node[above left] at (L1) {\huge $L_1$}; %L1

\node at (L2) {\color{gray}{\huge$\bullet$}}; %L2
\node[above right] at (L2) {\huge $L_2$}; %L2

\node at (L3) {\color{gray}{\huge$\bullet$}}; %L3
\node[above left] at (L3) {\huge $L_3$}; %L3

\node at (L4) {\color{gray}{\huge$\bullet$}}; %L4
\node[above right] at (L4) {\huge $L_4$}; %L4

\node at (L5) {\color{gray}{\huge$\bullet$}}; %L5
\node[below right] at (L5) {\huge $L_5$}; %L5

\end{tikzpicture}

结果如下:

在此处输入图片描述$

答案1

在此处输入图片描述

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{calc}

\begin{document}
\begin{tikzpicture}[scale=0.5]

% Variables
\def\muu{0.005}
\def\R{10}

\coordinate (C2) at ({(1-\muu)*\R},0);

%C2 orbit
\draw [thick] (0,0) circle ({(1-\muu)*\R});


\foreach \a in {45,135,225,-45} {%
    \draw[->,thick] (\a:{(1-\muu)*\R}) --++ (\a+90:1pt) ;}

% C2 rotation: 4 arrows
%\draw [thick, ->] (C2) arc (0:45:{(1-\muu)*\R});
%\draw [thick, ->] (C2) arc (0:45+90:{(1-\muu)*\R});
%\draw [thick, ->] (C2) arc (0:45+180:{(1-\muu)*\R});
%\draw [thick, ->] (C2) arc (0:45+270:{(1-\muu)*\R});

\end{tikzpicture}
\end{document}

答案2

这是使用标记的另一种方法。

\documentclass[tikz]{standalone}
\usetikzlibrary{decorations.markings}
\begin{document}

\begin{tikzpicture}[scale=0.5]

% Variables
\def\muu{0.005}
\def\R{10}


% Coordinates
\coordinate (L1) at ({\R*(1-(\muu/3)^(1/3))},0);
\coordinate (L2) at ({\R*(1+(\muu/3)^(1/3))},0);
\coordinate (L3) at ({-\R*(1+5/12*\muu)},0);
\coordinate (L4) at ({\R*(1/2*(1-2*\muu))},{\R*sqrt(3)/2});
\coordinate (L5) at ({\R*1/2*(1-2*\muu)},{-\R*sqrt(3)/2});
\coordinate (C1) at ({-\muu*\R},0);
\coordinate (C2) at ({(1-\muu)*\R},0);
\coordinate (G) at (0,0);


%C2 orbit
\draw [thick,
postaction={decorate,
   decoration={markings,mark=at position 0.125 with {\arrow{>};},
   mark=at position 0.375 with {\arrow{>};},
   mark=at position 0.625 with {\arrow{>};},
   mark=at position 0.875 with {\arrow{>};}}}
] (0,0) circle ({(1-\muu)*\R});



% 2 equilateral triangles
\draw [draw=red, dashed, every edge/.append style={draw=red, dashed}]
     (L4) -- node[sloped] {$\parallel$} (C1) 
     (L4) -- node[sloped] {$\parallel$} (C2) 
     (L5) -- node[sloped] {$\parallel$} (C1) 
     (L5) -- node[sloped] {$\parallel$} (C2);
\draw [draw=white, dashed, every edge/.append style={draw=red, dashed}]
     (C1) -- node[sloped] {$\parallel$} (C2);

% Degrees on each angle
\draw ({-\muu*\R+(1-\muu)*\R/5},0) arc (0:-60:{(1-\muu)*\R/5})  node[midway, below right] {\huge $60^\circ$}; %C1
\draw ({(1-\muu)*\R-(1-\muu)*\R/5},0) arc (180:240:{(1-\muu)*\R/5}) node[midway, below left] {\huge $60^\circ$}; %C2
\draw ({\R*1/2*(1-2*\muu)-(1-\muu)*\R/5*1/2},{-\R*sqrt(3)/2+(1-\muu)*\R/5*sqrt(3)/2}) arc (120:60:{(1-\muu)*\R/5}) node[midway, above] {\huge $60^\circ$}; %L5


% Axes
\draw [thick, dashed] ({-(\R*(1+(\muu/3)^(1/3))+1))},0)--({\R*(1+(\muu/3)^(1/3))+1},0); %x axis
\draw [thick, dashed] (0,{-(\R*(1+(\muu/3)^(1/3))+1))})--(0,{\R*(1+(\muu/3)^(1/3))+1}); %y axis



% Celestial bodies
\draw [thick, fill=yellow] (C1) circle (1); %C1
\draw [thick, fill=cyan] (C2) circle (0.25); %C2

% Lagrangian points
\node at (L1) {\color{gray}{\huge$\bullet$}}; %L1
\node[above left] at (L1) {\huge $L_1$}; %L1

\node at (L2) {\color{gray}{\huge$\bullet$}}; %L2
\node[above right] at (L2) {\huge $L_2$}; %L2

\node at (L3) {\color{gray}{\huge$\bullet$}}; %L3
\node[above left] at (L3) {\huge $L_3$}; %L3

\node at (L4) {\color{gray}{\huge$\bullet$}}; %L4
\node[above right] at (L4) {\huge $L_4$}; %L4

\node at (L5) {\color{gray}{\huge$\bullet$}}; %L5
\node[below right] at (L5) {\huge $L_5$}; %L5

\end{tikzpicture}
\end{document}

在此处输入图片描述

答案3

我不清楚圆半径和L...坐标的计算是否有任何意义(因为图像是一个插图,并且在图片上 10 和 9,995 之间的差异可以忽略不计)...但是,我保留了这个计算,但在下面的 mwe 中建议采用不同的方法,如何进行计算。

如果使用极坐标,为一些图片元素定义样式,使用tikzanglesquotes以及中的数学引擎进行计算tikz,图片代码会变得明显更简单、更短:

\documentclass[tikz, margin=3mm]{standalone}
\usetikzlibrary{angles,               % added for drawing andles
                decorations.markings,
                quotes}               % added for label anglews
\usepackage{siunitx}                  % added for writing units

\begin{document}
\begin{tikzpicture}[scale=0.5,
% styles of elements used in picture
crc/.style args = {#1/#2}{circle, draw, thick, inner sep=0pt,
                          fill=#1, minimum size=#2},
dot/.style = {circle, draw=gray, fill=gray, thick,
              minimum size=8pt, inner sep=0pt},
Ang/.style = {draw, <->,
              angle radius=30pt, angle eccentricity=1.5},
decoration = {markings,
              mark=between positions 0.125 and 1 step 0.25 with {\arrow[line width=2pt]{>}}}
                    ]
% Variables
\def\muu{0.005}
\def\r{10}
% all calculation is performed by math engine
\pgfmathsetmacro{\R}{(1-\muu)*\r}
\pgfmathsetmacro{\LL}{(1-(\muu/3)^(1/3))*\r}
\pgfmathsetmacro{\LR}{\r*(1+(\muu/3)^(1/3))}
% axis
\draw[dashed] (0,-1.1*\R) -- (0,1.1*\R);
\draw[dashed] (-1.1*\R,0) -- node[pos=0.7] {$\|$}(1.2*\R,0);
% C2 orbit
\draw [thick, postaction={decorate}] (0,0) circle (\R);
% yellow and blue circles
\node (Or)  [crc=yellow/24pt] at (  0:0)  {}; % yellow circle
\node (L0) [crc=blue!50/8pt] at (  0:\R) {};  % blue circle
% nodes L1 -- L5
\node (L1) [dot,label=above  left:$L_1$] at (\LL,0) {};
\node (L2) [dot,label=above right:$L_2$] at (\LR,0) {};
\node (L3) [dot,label=above  left:$L_3$] at (180:\R) {};
\node (L4) [dot,label=above right:$L_4$] at ( 60:\R) {};
\node (L5) [dot,label=below right:$L_5$] at (300:\R) {};
% red lines
\draw[red, dashed]  (Or) -- node[sloped,black] {$\|$} (L4)
                    (L4) -- node[sloped,black] {$\|$} (L0)
                    (Or) -- node[sloped,black] {$\|$} (L5)
                    (L5) -- node[sloped,black] {$\|$} (L0);
% angles
\pic[Ang,"\ang{60}"]   {angle = L5--Or--L0};
\pic[Ang,"\ang{60}"]   {angle = Or--L0--L5};
\pic[Ang,"\ang{60}"]   {angle = L0--L5--Or};
\end{tikzpicture}
\end{document}

这使

在此处输入图片描述

相关内容