绘制简单插图

绘制简单插图

用纯 LaTeX 代码绘制这样的图片有多难?

在此处输入图片描述

提前致谢。

答案1

一点也不难。

\documentclass[tikz,border=3mm]{standalone}
\usepackage{tikz-3dplot}
\begin{document}
\tdplotsetmaincoords{70}{110}
\begin{tikzpicture}[tdplot_main_coords,>=stealth,thick,line cap=round]
 \begin{scope}[canvas is xy plane at z=0]
  \draw (-3,-3) rectangle (3,3);
  \path (3,3) coordinate (br) (3,-3) coordinate (bl) 
  (2.2,-2.5) node{$S$} ;
 \end{scope}
 \path (0,0,0) coordinate (O) (0,0,3) coordinate (Z);
 \draw (intersection cs:
          first line ={(bl)--(br)},
          second line={(O)--(Z)},) coordinate (i)-- (0,0,-3);
 \draw[dashed] (i) -- (O);
 \draw[->] (O) -- (Z) node[above]{$S^\perp$};         
 \draw[->] (O)  -- (-1.8,1.8,0) coordinate (Psv) node[below]{$P_s(v)$};
 \draw[->] (O)  -- (-1.8,1.8,1.8)  coordinate (v) node[left]{$v$};
 \draw[->] (Psv) -- (v);
\end{tikzpicture}
\end{document}

在此处输入图片描述

相关内容