5

I'm trying to reproduce the Euler angles diagram, here is the first first rotation known as precession rotation

for clarification here they are

And I was successful reproducing this diagram in TikZ+pdfLaTeX

enter image description here

Here is the code for this portion

\documentclass[12pt]{book}

\usepackage[top = 1in,
            bottom = 1in,
            left = 0.75in,
            right = 0.75in
            ]{geometry}
\usepackage{tikz}
\usetikzlibrary{3d}

\usepackage{graphicx}
\usepackage{amsmath, amsfonts}
\usepackage{wrapfig}
\usepackage{pgfplots}
\begin{tikzpicture}[scale = 3]

\begin{document}

\begin{scope}[canvas is zx plane at y=0]

\draw [ultra thin, step = 0.25, lightgray](-1, -1) grid (1, 1);

\filldraw [fill = orange!20, draw = orange] (0, 0) -- (0.5, 0) arc [start angle = 0, end angle = 45, radius = 0.5] (0.71, 0.71) -- cycle;

\filldraw [fill = orange!20, draw = orange] (0, 0) -- (0, 0.5) arc [start angle = 90, end angle = 135, radius = 0.5] (-0.71, 0.71) -- cycle;
\draw [->, orange, ultra thick](0, 0) -- (1, 0);
\draw [->, orange, ultra thick](0, 0) -- (0, 1);
\draw [->, red, ultra thick] (0, 0) -- (0.71, 0.71);
\draw [->, red, ultra thick] (0, 0) -- (-0.71,
 0.71);

\node [anchor = north west] at (0, 1) {$\vec{i}$};
\node [anchor = north] at (1, 0) {$\vec{j}$};

\draw [green, ultra thick](0, 0) circle (1);

\end{scope}

\draw [->, orange, ultra thick] (0, 0, 0) -- (0, 1, 0);

\begin{scope}[canvas is zx plane at y=0.5]

\draw [->, blue](0, -0.15) arc [start angle = -90, end angle = 180, radius = 0.15];

\node [anchor = south west] at (0, 0.2) {$\dot{\Psi}\vec{z_0}$};

\end{scope}

\node [anchor = south east] at (0, 1, 0) {$\vec{z_0}$};
\end{tikzpicture}
\end{document}

Now what I want to do is to rotate this tikzpicture as the rotation in the picture (some modifications are tolerated)

enter image description here

I tried to hard, I found other people who had done an amazing rotation, like the box rotation at texample

your help is appreciated, and in case it is important, I'm using book as a document class, running MikTeX.

3
  • 1
    Welcome to TeX.SX! Please make your code compilable (if possible), or at least complete it with \documentclass{...}, the required \usepackage's, \begin{document}, and \end{document}. That may seem tedious to you, but think of the extra work it represents for TeX.SX users willing to give you a hand. Help them help you: remove that one hurdle between you and a solution to your problem. Commented Oct 12, 2021 at 12:27
  • Duplicate of How to draw an Euler angle rotation sequence with TikZ? Commented Oct 12, 2021 at 13:52
  • I think no, I saw that post, but the user's issue, isn't 3d rotation, but rather angles indicators, which is not my problem, even his drawing is not similar to mine, his rotations are simple, and either calculated by hand, or set arbitrary, the only common thing is the subject written about Commented Oct 12, 2021 at 13:59

1 Answer 1

8

You can achieve that with the options rotate around x, rotate around y, rotate around z which allows you to rotate the coordinate system around one of the current axes.

Something like this:

\documentclass[tikz,border=2mm]{standalone}
\usetikzlibrary{3d}

\begin{document}
\begin{tikzpicture}[scale=3,line cap=round]
\begin{scope}[rotate around y=45,rotate around z=30,canvas is zx plane at y=0]
  \draw [green!50!black, dashed, ultra thick] (-1,0) arc (180:360:1);
\end{scope}

\begin{scope}[canvas is zx plane at y=0]
  \draw [ultra thin, step = 0.25, lightgray] (-1,-1) grid (1,1);
  \draw [dashed, red] (225:1) -- (0,0) -- (135:1);
  \draw [green, ultra thick] (0, 0) circle (1);
  \foreach\i in{0,90}
  {
    \filldraw [fill= orange!20, draw = orange] (0,0) -- (\i:0.5) arc (\i:\i+45:0.5) -- cycle;
    \draw [->, orange, ultra thick] (0,0) -- (\i:1);
  }
  \node [anchor = north west] at (0, 1) {$\vec{i}$};
  \node [anchor = north]      at (1, 0) {$\vec{j}$};
\end{scope}

\begin{scope}[rotate around y=45,rotate around z=30]
  \draw [canvas is zx plane at y=0, green!50!black, ultra thick] (1, 0) arc (0:180:1);
  \foreach\i in {0,90}
    \filldraw [canvas is xy plane at z=0, fill=red!20, draw=red] (0,0) -- (\i-30:0.4) arc (\i-30:\i:0.4) -- cycle;
  \draw [->, red, ultra thick] (0,0,0) -- (1,0,0);
  \draw [->, red, ultra thick] (0,0,0) -- (0,1,0);
  \draw [->, red, ultra thick] (0,0,0) -- (0,0,1);
\end{scope}

\draw [->, orange, ultra thick] (0,0,0) -- (0,1,0) node[black, anchor=south east] at (0, 1, 0) {$\vec{z_0}$};
\draw [canvas is zx plane at y=0.75, ->, blue] (0,-0.15) arc (-90:180:0.15);
\node at (0.3,0.9) {$\dot{\Psi}\vec{z_0}$};

\end{tikzpicture}
\end{document}

enter image description here

3
  • thanks, I never found this information in the tikz documentation by Mr. Till Tantu Commented Oct 12, 2021 at 14:56
  • @AllawHussein, it's not part of the 3d library, sorry for the (now edited) mistake. It's in the transformations section, p.379 in my version (3.1.8b). Commented Oct 14, 2021 at 8:28
  • I was gonna ask you about such docuemntation, the best I could find was a source file examination at tex.stackexchange.com/questions/75945/…, thanks I found your section it is page 374 in v3.1.9a (for other users). Commented Oct 14, 2021 at 12:23

You must log in to answer this question.

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