我正在尝试重现欧拉角图,这是第一次旋转,称为进动旋转
我成功地在 TikZ+pdfLaTeX 中重现了该图表
这是此部分的代码
\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}
现在我想要做的是将这个 tikzpicture 旋转为图片中的旋转(可以容忍一些修改)
我努力尝试,我发现其他人也做了很棒的旋转,比如示例
感谢您的帮助,如果它很重要,我正在使用书籍作为文档类,运行 MikTeX。
答案1
您可以使用选项rotate around x
、来实现这一点rotate around y
,rotate around z
它允许您围绕当前轴之一旋转坐标系。
像这样:
\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}