I'm trying to draw a diagram representing the orbital elements (only the angles) to obtain something like the following:

enter image description here

At the moment I have only drawn the Line of Nodes and the right ascension of the ascending node $\Omega$. I'm having problems in drawing the actual orbit (the circle in solid line) because I can't figure out how to set tikz-3dplot's rotated coordinate system. Any suggestion on how to go about that?

Here is my code and the result so far:

  \pgfmathsetmacro{\O}{45} % right ascension of ascending node [deg]
  \pgfmathsetmacro{\i}{30} % inclination [deg]

  \draw[->] (0,0,0) -- (1,0,0) node[anchor=north east]{$x$};
  \draw[->] (0,0,0) -- (0,1,0) node[anchor=north west]{$y$};
  \draw[->] (0,0,0) -- (0,0,1) node[anchor=south]{$z$};



  \draw [tdplot_rotated_coords] (-1,0,0) -- (1,0,0) node [below] {Line of Nodes};

enter image description here

  • If you want to change your plane to, say 30^\circ, then replace \tdplotsetrotatedcoords{\O}{0}{0} with \tdplotsetrotatedcoords{\O}{30}{0}. Aug 12, 2017 at 14:43
  • @JohnKormylo Thanks for your comment. However, the rotation you suggest is made around the unrotated y-axis, while I would like to rotate around the transformed x-axis. In short, my transformed frame is should be obtained by a first rotation around the z-axis and then another rotation around the new x-axis. I could achieve the first one but not the second one, sorry if I wasn't clear enough in the question.
    – Pier Paolo
    Aug 12, 2017 at 14:58
  • 2
    The rotaions are applied sequentially, and the third argument is in the same direction as the first. For example \tdplotsetrotatedcoords{90}{90}{-90} IIRC will swap the y and z axes. Aug 12, 2017 at 15:04
  • This question seems to be something similar: tex.stackexchange.com/questions/119871/… Aug 12, 2017 at 20:46

3 Answers 3


Thanks to @JohnKormylo's suggestions I could reproduce the figure to a satisfactory degree, even if it is not 100% accurate.

  \pgfmathsetmacro{\O}{45} % right ascension of ascending node [deg]
  \pgfmathsetmacro{\i}{30} % inclination [deg]
  \pgfmathsetmacro{\f}{35} % true anomaly [deg]

  \coordinate (O) at (0,0,0);

  \draw [->] (O) -- (2,0,0) node[anchor=north east] {$x$};
  \draw [->] (O) -- (0,1,0) node[anchor=north west] {$y$};
  \draw [->] (O) -- (0,0,1) node[anchor=south] {$z$};

  \node at (0,-\r,0) [left,text width=4em] {Ecliptic Plane};



  \draw [tdplot_rotated_coords] (-1,0,0) -- (1,0,0) node [below right] {Line of Nodes};

    % \draw[->] (O) -- (1,0,0) node [above] {$x'$};
    % \draw[->] (O) -- (0,1,0) node [above] {$y'$};
    \draw[->] (O) -- (0,0,1) node [above] {$\hat{h}$};
    \draw (1,0,0) -- (-1,0,0);
    \coordinate (P) at (180+\f:\r);
    \draw (O) -- (P);
    \tdplotdrawarc[->]{(O)}{.33*\r}{180}{180+\f}{anchor=south west}{$\nu$}

    \draw [->] (P) -- (-1,0,0) node [right] {$\hat{r}$};
    \draw [->] (P) -- (0,-1,0) node [above] {$\hat{\theta}$};
    \draw [->] (P) -- (0,0,1) node [above] {$\hat{k}$};
    \fill (P) circle (.33ex);

  \tdplotdrawarc[tdplot_rotated_coords,->]{(O)}{.75*\r}{0}{\i}{anchor=south}{$i$} % not accurate :(

enter image description here


Visit this Overleaf project to find a Latex Beamer example.




\usepackage{tikz}   %TikZ is required for this to work.  Make sure this exists before the next line
\usepackage{tikz-3dplot} %requires 3dplot.sty to be in same directory, or in your LaTeX installation

    % Orbital elements or Keplerian elements
                \fill (0,0) coordinate (O) circle (5pt) node[left =7pt] {$M_\oplus$};
                % Draw equatorial ellipse
                %\tdplotdrawarc[thin]{(0,0,0)}{\r}{-90}{205}{label={[xshift=-3.7cm, yshift=0.9cm]Equatorial plane}}{}
                % Draw equatorial plane
                \draw[] (0,-\r,0) -- (\r,-\r,0)  node[below]{Equatorial plane} -- (\r,\r,0) -- (-\r,\r,0) -- (-\r,-0.65*\r,0);
                \draw[dotted] (-\r,-0.65*\r,0) -- (-\r,-\r,0) -- (0,-\r,0);
                % Draw ellipses intersection. Line of nodes
                \draw[dashed] (0,-1.3*\r,0) -- (0,1.3*\r,0) node[right] {Line of nodes};
                % Draw gamma direction
                % Set gamma direction
                \draw[->] (0,0,0) -- (Pg) node[anchor=east] {Reference direction $\boldsymbol{\gamma}$};
                % Create a new rotated system in the center
                % Draw orbital ellipse
                \tdplotdrawarc[tdplot_rotated_coords,thin,blue]{(0,0,0)}{\r}{-125}{180}{label={[xshift=-5.7cm, yshift=-2.2cm]Orbital plane}}{}
                % Define m position
                % Draw a vector to m
                \draw[tdplot_rotated_coords,thin,->,blue] (0,0,0) -- (\xmRot,\ymRot,\zmRot);
                % Draw a mass
                \filldraw[tdplot_rotated_coords, blue] (\xmRot,\ymRot,\zmRot) circle (2pt) node[above left] {$m$};
                % Draw periapsis line
                \draw[dashed,tdplot_rotated_coords,blue] (0,0,0) -- (0,\r,0) node[anchor=south west] {Periapsis};
                % Draw omega angle
                \tdplotdrawarc[tdplot_rotated_coords,thick,-stealth,blue]{(0,0,0)}{0.4*\r}{0}{\omegaSatellite}{anchor=south west}{$\omega$}
                % Draw nu angle
                \tdplotdrawarc[tdplot_rotated_coords,thick,-stealth,blue]{(0,0,0)}{0.4*\r}{\omegaSatellite}{\omegaSatellite+\nuSatellite}{anchor=south west}{$\nu$}
                % Create rotated shifted system at (0,\r,0)
                % Draw \Omega
                % Hidden part of the arc
                %% \tdplotdrawarc[tdplot_rotated_coords,dashed,thick,brown]{(0,0,0)}{0.4*\r}{0}{90}{anchor=south}{}%{$\Omega$}
                % Visible part of the arc
                \tdplotdrawarc[tdplot_rotated_coords,thick,-stealth,brown]{(0,0,0)}{0.4*\r}{\gammaAngle-180}{270}{anchor=north east}{$\Omega$}
                % Shift the rotated coordinates
                \coordinate (Shift) at (0,\r,0);
                % \draw[thick,tdplot_rotated_coords,->,blue] (0,0,0) -- (.5,0,0) node[anchor=north west]{$x_2$};
                % \draw[thick,tdplot_rotated_coords,->,blue] (0,0,0) -- (0,.5,0) node[anchor=north]{$y_2$};
                % \draw[thick,tdplot_rotated_coords,->,blue] (0,0,0) -- (0,0,.5) node[anchor=south west]{$z_2$};
                % Draw inclination angle
            \caption{Orbital elements or Keplerian elements}\label{fig:elipseNodos2}
  • 2
    I took the liberty of adding the code of your link as well as a screenshot because this link is interesting instead of voting to delete your answer.
    – AndréC
    Jul 14, 2020 at 8:39
  • Good Idea. Thank you!
    – J.Perez
    Jul 16, 2020 at 9:35

Following code show my try without tikz-3dplot. Just for fun:) enter image description here

\documentclass[tikz, border=1cm]{standalone}
\usetikzlibrary{3d, calc}
  plane/.code args={#1and#2}{
    \edef\temp@a{(\the\pgf@x, \the\pgf@y)};
    \edef\temp@b{(\the\pgf@x, \the\pgf@y)};
      plane x={\temp@a},
      plane y={\temp@b},
      canvas is plane,

  \draw[thick, red!20] (135:4cm) -- (-45:4cm);
  \foreach \i [evaluate=\i as \c using \i/170*100] in {0, 10, ..., 170} {
    \draw[plane={(-45:0.5cm) and (\i:1cm)}, fill=red!\c!violet, opacity=.1] (0, 0) circle (2cm);
%   \fill[plane={(-45:0.5cm) and (0:1cm)}, red, opacity=.5] (-3, -3) rectangle (3, 3);

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .