Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Jubobs generated this code from Drawing a hyperbolic trajectory.

If we draw a horizontal line that intersects the hyperbola (I really dont want to add this to the picture), we would have some angle. I want to make this angle 90. How can we do this? I know we could use rotate around but what would we rotate around to keep the same orientation of the trajectory? (0,0) is not the point and how much would we need to rotate it?

Additionally, the trajectory has to be offset 16193.6km from the center of the earth. So if we want the trajectory to pass by Earth at Periapsis with 6878 km, we need to have the a ratio offset of 2.3544.

Is there a cleaner method?

\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}

Here is a crude drawing: enter image description here

share|improve this question

1 Answer 1

up vote 2 down vote accepted

I ended up just rotating everything around the focus which is a*e

enter image description here

 \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}
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.