TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?


    \pgfmathsetmacro{\e}{1.44022}               % eccentricity of the hyperbola
    \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

    \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
  \foreach \k in {0,1,...,\N}{
        \shade[top color=black,bottom color=gray]
            ({\a*cosh(\theta)}, {\b*sinh(\theta)}) circle (\UFOradius);


Here is a crude drawing: enter image description here

share|improve this question
up vote 2 down vote accepted

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

enter image description here

          \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{\b}{\a*sqrt((\e)^2 - 1)}

              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         
              \foreach \k in {0,1,...,\N}{
                \shade[top color = black, bottom color = gray, rotate around
                = {-43.9:(.576088,0)}]
                ({\a*cosh(\theta)}, {\b*sinh(\theta)}) circle (\UFOradius);
            \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)
              \node[scale = .75, fill = white, inner sep = .01cm] at (-23:.2cm)
share|improve this answer

Your Answer


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.