Jubobs 生成了此代码绘制双曲线轨迹。
如果我们画一条与双曲线相交的水平线(我真的不想把它添加到图片中),我们会有一些角度。我想制作这个角度90
。我们该怎么做?我知道我们可以使用rotate around
,但我们要旋转什么才能保持轨迹的方向相同? (0,0)
不是重点,我们需要旋转多少?
此外,轨迹必须16193.6
与地心偏移 千米。因此,如果我们想让轨迹以6878
千米的距离在近地点经过地球,我们需要偏移2.3544
。
有没有更清洁的方法?
\usepackage{tikz}
\begin{document}
\begin{center}
\begin{tikzpicture}[scale=2]
\pgfmathsetmacro{\e}{1.44022} % eccentricity of the hyperbola
\pgfmathsetmacro{\a}{1}
\pgfmathsetmacro{\b}{\a*sqrt((\e)^2 - 1)}
\pgfmathsetmacro{\c}{sqrt((\a)^2+(\b)^2} % distance from centre to focus
\pgfmathsetmacro{\Earthradius}{0.1} % Earth radius
\pgfmathsetmacro{\UFOradius}{.03}
\pgfmathsetmacro{\thetamax}{1.2}
\draw plot[domain = -\thetamax:\thetamax] ({\a*cosh(\x)}, {\b*sinh(\x)});
\path (\c,0) node(a) {\includegraphics[width=.5cm]{earth.png}};
\pgfmathtruncatemacro{\N}{8} % an even number is best here
\pgfmathsetmacro{\thetaoffset}{.05*\thetamax}
\foreach \k in {0,1,...,\N}{
\pgfmathsetmacro{\theta}{(\thetamax-\thetaoffset)*(2*\k/\N-1)}
\shade[top color=black,bottom color=gray]
({\a*cosh(\theta)}, {\b*sinh(\theta)}) circle (\UFOradius);
}
\end{tikzpicture}
\end{center}
\end{document}
以下是一张粗略的图画:
答案1
我最后只是围绕焦点旋转一切a*e
\begin{center}
\begin{tikzpicture}[line join = round, line cap = round, scale = 4,
>=triangle 45]
\draw (2.2,0) -- (.46,0.13);
\draw (0.57,0) -- (2.2,0);
\draw[rotate around = {-43.9:(.576088,0)}] (0,0) -- (.65,0);
\begin{scope}[decoration = {markings,
mark = at position 0.2 with {\arrow{>}},
mark = at position 0.7 with {\arrow{>}}, }]
\pgfmathsetmacro{\e}{1.44022}
\pgfmathsetmacro{\a}{.4}
\pgfmathsetmacro{\b}{\a*sqrt((\e)^2 - 1)}
\pgfmathsetmacro{\c}{sqrt((\a)^2+(\b)^2}
\pgfmathsetmacro{\Earthradius}{0.1}
\pgfmathsetmacro{\Sunradius}{0.17}
\pgfmathsetmacro{\UFOradius}{.02}
\pgfmathsetmacro{\thetamax}{1.5}
\shade[%
top color=yellow!70,%
bottom color=red!70,%
shading angle={45},%
] (2.2,0) circle (\Sunradius);
\draw[postaction = decorate, rotate around = {-43.9:(.576088,0)}]
plot[domain = -\thetamax:\thetamax]
({\a*cosh(\x)}, {\b*sinh(\x)});
\path (\c,0) node(a) {\includegraphics[width=.5cm]{earth.png}};
\pgfmathtruncatemacro{\N}{6} % an even number is best here
\pgfmathsetmacro{\thetaoffset}{.05*\thetamax}
\foreach \k in {0,1,...,\N}{
\pgfmathsetmacro{\theta}{(\thetamax-\thetaoffset)*(2*\k/\N-1)}
\shade[top color = black, bottom color = gray, rotate around
= {-43.9:(.576088,0)}]
({\a*cosh(\theta)}, {\b*sinh(\theta)}) circle (\UFOradius);
}
\end{scope}
\begin{scope}[rotate around = {-43.9:(.576088,0)}]
\draw (0,0) -- (46.0254:1.25cm);
\draw (0,0) -- (-46.0254:1.25cm);
\draw (-46.0254:.2cm) arc (-46.0254:46.0254:.2cm);
\node[scale = .75, fill = white, inner sep = .01cm] at (23:.2cm)
{$\beta$};
\node[scale = .75, fill = white, inner sep = .01cm] at (-23:.2cm)
{$\beta$};
\end{scope}
\end{tikzpicture}
\end{center}