大家晚上好。我有一段代码,需要稍微修改一下才能制作出我在此处附上的照片中所示的“波浪曲线”。
\documentclass{article}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\draw [thick, gray, ->] (0,-1) -- (0,5) % draw y-axis line
node [above, black] {$x_{3}$}; % add label for y-axis
\draw [thick, gray, ->] (-5,0) -- (5,0) % draw x-axis line
node [right, black] {$x_{2}$}; % add label for x-axis
\draw [thick, black, ->] (0,0) -- (-4,4) % draw y-axis line
node [above, black] {$x^{'}_{3}$}; % add label for y-axis
\draw [thick, black, ->] (0,0) -- (4,4) % draw x-axis line
node [right, black] {$x^{'}_{2}$}; % add label for x-axis
\filldraw[fill opacity=0.1,fill=blue] (0,0) -- (1,0) arc (0:135:1cm) node[midway,above,opacity=1.0]{$\theta$} -- cycle;
\filldraw[fill opacity=0.1,fill=red] (0,0) -- (2,0) arc (0:45:2.0cm) node[midway,right,opacity=1.0]{$\phi=\theta-90^{\circ}$} -- cycle;
\end{tikzpicture}
\end{document}
答案1
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{decorations.pathmorphing}
\begin{document}
\begin{tikzpicture}[
S/.style = {% Snake
->, decorate,
decoration={snake,amplitude=2mm,segment length=5mm,post length=2mm},
draw=#1, thick
}
]
% axes
\path [draw=gray, thick, ->] (0,-1) -- (0,5) node [above] {$x_{3}$};
\path [draw=gray, thick, ->] (-5,0) -- (5,0) node [right] {$x_{2}$};
% rotated axes
\path [draw=gray, thick, ->] (0,0) -- (-4,4) node [above] {$x^{'}_{3}$};
\path [draw=gray, thick, ->] (0,0) -- ( 4,4) node [right] {$x^{'}_{2}$};
% angles
\filldraw[fill=blue, fill opacity=0.1]
(0,0) -- (1,0) arc (0:135:1cm) node[midway,above, text opacity=1] {$\theta$} -- cycle;
\filldraw[fill opacity=0.1,fill=red]
(0,0) -- (2,0) arc (0: 45:2cm) node[midway,right, text opacity=1] {$\phi=\theta-90^{\circ}$} -- cycle;
% snakes
\draw [S= red] ( 30:22mm) -- ++ ( 45:21mm);
\draw [S= red] ( 60:22mm) -- ++ ( 45:21mm) node[above right] {$Q_1$};
%
\draw [S=blue] (120:22mm) -- ++ (135:21mm) node[above left] {$Q_2$};
\draw [S=blue] (150:22mm) -- ++ (135:21mm);
\end{tikzpicture}
\end{document}