TikZ:具有倾斜轴的坐标系

TikZ:具有倾斜轴的坐标系

如何在(正常)TikZ 中正确声明这样的坐标系?

在此处输入图片描述

\documentclass[margin=5pt]{standalone}
\usepackage{tikz} 

\begin{document}
% isosceles triangle
\def\a{1}
\def\c{1.5}
% pyramid
\def\h{0.2}

\begin{tikzpicture}[font=\footnotesize,
z={(0,1,0)},           % this
x={(1,-cos(30),0)},   % is
 y={(1,cos(0),0)},    % not good...
]

% KoSy
\begin{scope}[->, shift={(-2cm,2cm)}]
\draw[] (0,0,0) -- (1,0,0) node[pos=1.1]{$x$};
\draw[] (0,0,0) -- (0,1,0) node[pos=1.1]{$y$};
\draw[red] (0,0,0) -- (0,0,1) node[pos=1.1]{$z$};
\end{scope}

\coordinate[label=below:A] (A1) at (0,0,0);
\coordinate[label=below:B] (B1) at (\c,0,0);
\coordinate[label=below:C] (C1) at (0,\a,0);

\draw[] (A1) -- (B1) -- (C1) -- cycle;
\end{tikzpicture}
\end{document}

答案1

x可以通过定义、y和以及在坐标中z使用来指定坐标系。cm

cm类似地,使用起点和半径绘制圆弧。

在此处输入图片描述

\documentclass[border=6pt]{standalone}
\usepackage{tikz}
\usepackage{siunitx}
\begin{document}
\begin{tikzpicture}[x={(-20:1cm)},y={(10:1cm)},z={(0cm,1cm)}]
\draw[orange,->] (0,0,0)--(4,0,0) node[right] {$x$};
\draw[orange,->] (0,0,0)--(0,4,0) node[right] {$y$};
\draw[orange,->] (0,0,0)--(0,0,2) node[above] {$z$};
\draw[orange] (0,0,0)--(4cm,0cm);
\draw[orange] (0:2cm) arc[start angle=0,end angle=-20,radius=2cm] node[left,midway] {\ang{20}};
\draw[orange] (0:3cm) arc[start angle=0,end angle=10,radius=3cm] node[left,midway] {\ang{10}};
\def\x{0.7}
\def\y{1}
\def\z{1}
\draw[fill=blue!50] (0,0,\z)--(0,\y,0)--(0,\y,\z)--cycle;
\draw (0,0,\z)--(\x,0,\z)--(0,\y,0);
\draw (\x,0,\z)--(0,\y,\z);
\draw[gray] (\x,0,\z)--(\x,0,0)--(0,\y,0);
\end{tikzpicture}
\end{document}

相关内容