绘制平面和矢量

绘制平面和矢量

创建类似附件的图表的最佳方法是什么?我简要查看了该tikz-3dplot软件包,但它似乎不太方便我的目的。当我处理一个平面时,使用tikz或的平行四边形tkz-euclid可以完成工作,但我认为这不是这里的最佳选择。提前致谢。

在此处输入图片描述

编辑(为了让事情更简洁):我如何复制该图表。我不确定如何绘制两个相交平面。

答案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}

在此处输入图片描述

相关内容