答案1
这是一个使用 Ti 的选项钾Z 库:
3d
选项canvas is ...
允许您在与坐标平面平行的平面上绘制。您也可以在rotate around
这些平面上绘制任意轴。perspective
选择3d view
。
我也制作了几种样式,一种用于每个平面,另一种用于矢量。
例如:
\documentclass[tikz,border=1.618mm]{standalone}
\usetikzlibrary{3d,perspective}
\pgfmathsetmacro\anglelp{-5} % rotation of light plane
\pgfmathsetmacro\angledp{-50} % rotation of dark plane
\tikzset
{
light plane/.style={rotate around x=\anglelp, canvas is xz plane at y=0,draw=cyan,fill=cyan!5},
dark plane/.style={rotate around x=\angledp,canvas is xy plane at z=0,draw=cyan,fill=cyan!25},
vector/.style={rotate around x=#1, canvas is yz plane at x=0,-latex,thick,draw=blue}
}
\begin{document}
\begin{tikzpicture}[3d view={120}{20},line join=round]
% planes
\draw[dark plane] (-2,-2) rectangle (2,0);
\draw[light plane] (-2,-2) rectangle (2,4);
\draw[dark plane] (-2, 0) rectangle (2,4);
% vectors
\draw[vector=\anglelp] (0,1) coordinate (o1) --++ (4,0) coordinate (n1) node[below] {$n_1$};
\draw[vector=\angledp] (1,0) coordinate (o2) --++ (0,4) coordinate (n2) node[above] {$n_2$};
\coordinate (i) at (intersection of o1--n1 and o2--n2); % intersection of both vectors
% angles
\draw[dashed] (o1) -- (0,0,0) -- (o2);
\draw[canvas is yz plane at x=0] (90+\anglelp:0.5) arc (90+\anglelp:\angledp:0.5) node[midway,right] {$\theta$};
\draw[canvas is yz plane at x=0] (i) ++ (90+\angledp:0.5) arc (90+\angledp:\anglelp:0.5) node[midway,right] {$\alpha$};
\draw[canvas is yz plane at x=2] (270+\anglelp:0.5) arc (270+\anglelp:360+\angledp:0.5) node[midway,below] {$\alpha$};
\end{tikzpicture}
\end{document}