如何在 Tikz/PStricks 中绘制曲线系统?

如何在 Tikz/PStricks 中绘制曲线系统?

有人可以帮我画出这个坐标系吗?

在此处输入图片描述

来源: https://en.wikipedia.org/wiki/File:General_curvilinear_coordinates_1.svg

我目前所做的:

\documentclass{article} 
\usepackage{tikz} \usepackage{tikz-3dplot} \usetikzlibrary{calc} 
\tikzset{>=latex}

\begin{document} \tdplotsetmaincoords{60}{110}

\begin{tikzpicture}[scale=5,tdplot_main_coords]
     \coordinate (O) at (0,0,0);
     \draw[thick,->] (0,0,0) -- (1,0,0) node[anchor=north east]{$q_1$ axis};
     \draw[thick,->] (0,0,0) -- (-0.6,1,0) node[anchor=north west]{$q_2$ axis}; 
\draw[thick,->] (0,0,0) -- (0,0,1)
 node[anchor=south]{$q_3$ axis};
         \draw (1.1,0.2,0) node[circle, inner sep=0.8pt, fill=blue, label=
{below:{$q_1$}}] (q1) {};  
             \draw[color=blue] (0,0) to [bend right=9] (q1);
         \draw (-0.2,1,0) node[circle, inner sep=0.8pt, fill=blue, label=
{below:{$q_2$}}] (q2) {};  
             \draw[color=blue] (0,0) to [bend left=8] (q2);
         \draw (1.1,0,1) node[circle, inner sep=0.8pt, fill=blue, label={below:
{$q_3$}}] (q3) {};  
             \draw[color=blue] (0,0) to [bend right=45] (q3);
 \end{tikzpicture} 
\end{document}

在此处输入图片描述

答案1

对这些不是特别满意,我认为它们可以简化,但无论如何,一种方法是剪辑和分层......

\documentclass[tikz,border=5]{standalone}
\usetikzlibrary{backgrounds,arrows.meta}
\begin{document}
\begin{tikzpicture}[x=(10:4cm),y=(90:4cm),z=(225:4cm),>=Triangle]
\coordinate (O) at (0,0,0); 
\draw [->] (O) -- (1,0,0) node [at end, right] {$q_2$ axis};
\draw [->] (O) -- (0,1,0) node [at end, above] {$q_3$ axis};
\draw [->] (O) -- (0,0,1) node [at end, left]  {$q_1$ axis};

\draw [draw=blue, -Circle] (O) to [bend left=8] 
  coordinate [pos=7/8] (q2n) 
  (1,-1/4,0) coordinate (q2) node [right] {$q_2$};
\draw [draw=blue, -Circle] (O) to [bend right=8] 
  coordinate [pos=7/8] (q3n) 
  (0,1,1/2) coordinate (q3) node [left] {$q_3$};
\draw [draw=blue, -Circle] (O) to [bend right=8] 
  coordinate [pos=7/8] (q1n) 
  (1/4,0,1) coordinate (q1) node [right] {$q_1$};

\begin{pgfonlayer}{background}
\begin{scope}
\clip (O) to [bend left=8] (q2) -- (1,1,0) -- (q3n) to [bend right=8] (O);
\shade [left color=green, right color=green!15!white, shading angle=135]
  (O) to [bend left] (q3n) to [bend left=16] (3/4,1/2,0) to [bend left=16] (q2n) -- cycle;
\end{scope}

\begin{scope}
\clip (O) to [bend left=8] (q2) -- (1,0,1) -- (q1) to [bend left=8] (O);
\shade [left color=red, right color=red!15!white, shading angle=45]
  (O) to [bend right] (q1n) to [bend left=16] (1,0,1) to [bend left=16] 
  (q2n) to [bend right] (O);
\end{scope}

\begin{scope}
\clip (O) to [bend right=8] (q1) -- (0,1,1) -- (q3) to [bend left=8] (O);
\shade [left color=cyan, right color=cyan!15!white, shading angle=225] 
  (O) -- (q1n) to [bend right=16] (0,1,1) to [bend left=16] (q3n) 
to [bend left] (O);
\end{scope}
\end{pgfonlayer}

\node at (1/3,1/3,0) {$q_1=\mbox{const}$};
\node at (0,1/2,1/2) {$q_2=\mbox{const}$};
\node at (1/2,0,1/3) {$q_3=\mbox{const}$};
\end{tikzpicture}
\end{document}

在此处输入图片描述

...另一个使用自定义坐标系:

\documentclass[tikz,border=5]{standalone}
\usetikzlibrary{arrows.meta}
\tikzset{declare function={f(\x)=sin(\x*100)/10;},
  non-linear cs/.cd,
    x/.store in=\nlx,y/.store in=\nly,z/.store in=\nlz,
    x=0,y=0,z=0}
\tikzdeclarecoordinatesystem{non-linear}{%
  \tikzset{non-linear cs/.cd,#1}%
  \pgfpointxyz{(\nlx)-f(\nly)*3+f(\nlz)}%
    {-f(\nlx)*2+(\nly)-f(\nlz)}{-f(\nlx)-f(\nly)+(\nlz)}}
\begin{document}
\begin{tikzpicture}[x=(10:3cm),y=(90:3cm),z=(215:2.75cm),
  >=Triangle, */.tip=Circle,
  domain=0:1, samples=50, variable=\t]
\coordinate (O) at (0,0,0); 

\shade [left color=green, right color=green!15!white, shading angle=135]
  (O) \foreach \x/\y in{\t/0,1/\t,1-\t/1,0/1-\t}{
     -- plot [smooth] (non-linear cs:x=\x, y=\y) };
\shade [left color=red, right color=red!15!white, shading angle=45]  
  (O) \foreach \x/\z in{\t/0,1/\t,1-\t/1,0/1-\t}{
     -- plot [smooth] (non-linear cs:x=\x, z=\z) };
\shade[left color=cyan, right color=cyan!15!white, shading angle=225] 
  (O) \foreach \y/\z in{\t/0,1/\t,1-\t/1,0/1-\t}{
     -- plot [smooth] (non-linear cs:y=\y, z=\z) };

\draw [thick, draw=blue, -*] (O) -- plot [domain=0:1.125, smooth] 
  (non-linear cs:x=\t) node [right] {$q_2$};
\draw [thick, draw=blue, -*] (O) -- plot [domain=0:1.125, smooth] 
  (non-linear cs:y=\t) node [above] {$q_3$};
\draw [thick, draw=blue, -*] (O) -- plot [domain=0:1.125, smooth] 
  (non-linear cs:z=\t) node [below] {$q_1$};

\draw [thick, ->] (O) -- (5/4,0,0) node [at end, right] {$q_2$ axis};
\draw [thick, ->] (O) -- (0,5/4,0) node [at end, above] {$q_3$ axis};
\draw [thick, ->] (O) -- (0,0,5/4) node [at end, left]  {$q_1$ axis};

\node at (1/2,1/2,0) {$q_1=\mbox{const}$};
\node at (0,1/2,2/3) {$q_2=\mbox{const}$};
\node at (3/4,0,3/4) {$q_3=\mbox{const}$};
\end{tikzpicture}
\end{document}

在此处输入图片描述

相关内容