我认为这是完美的,我正试图在 Tikz 中重新创建。我尝试定义一个平面,也尝试查看在 3D 空间中绘制平面但 Tikz 中的所有内容似乎都太具体了,我似乎找不到可以帮助我弄清楚如何绘制此类内容的通用指南。对于新用户来说,这非常令人畏惧。到目前为止,我尝试过的所有方法看起来都完全错误。
任何帮助,将不胜感激!!
答案1
欢迎来到 TeX.SX!我不认为你真的需要任何库,因为普通的 Ti钾Z 已经自带了一些基本的 3D 绘图工具。也许下面的内容可以帮助到你(解释见代码中的注释):
\documentclass[border=10mm]{standalone}
\usepackage{tikz}
\begin{document}
% you can use the options x, y and z to declare your coordinate system,
% for example, x={(20:10mm)} means "1 on the x axis be at coordinate (20:10mm) on the canvas"
% (of course, you can also use cartesian coordinates to define x, y and z)
\begin{tikzpicture}[x={(20:10mm)}, y={(100:15mm)}, z={(5:10mm)}, >=stealth]
% first, we draw the plane keeping the y coordinate at zero:
\fill[black!10] (-2,0,-1) -- (-2,0,1) -- (2,0,1) -- (2,0,-1) -- cycle;
% then, we define some coordinates:
\coordinate (o) at (0,0,0);
\coordinate (a) at (0,1,0);
\coordinate (b) at (1,0,0);
\coordinate (c) at (1,-1,0);
\coordinate (x) at (1,1,0);
% finally, we draw the arrwos by connecting the coordinates and attach labels
\draw[very thick, ->] (o) -- (0,.33,0) node[midway, left] {$u$};
\draw[thick, ->, gray] (o) -- (a) node[black, left] {$(u^Hx)u$};
\draw[thick, ->, green] (o) -- (b) node[black, right] {$x-(u^Hx)u$};
\draw[thick, ->, red] (o) -- (x) node[black, above right] {$x$};
\draw[gray] (a) -- (x);
\draw[thick, ->, gray, dashed] (x) -- (b) node[black, midway, right, font=\scriptsize] {$-(u^Hx)u$};
\draw[thick, ->, gray, dashed] (b) -- (c) node[black, midway, right, font=\scriptsize] {$-(u^Hx)u$};
\draw[thick, ->, blue] (o) -- (c) node[black, below] {$(I-2uu^H)x$};
\end{tikzpicture}
\end{document}
答案2
我认为 TikZ(内部 2D)足以完成这个简单的任务,请参阅上面的 Jasper Habicht 的回答。下面是使用 3D Asymptote 的替代方案。你看到了吗住户反思通过数字和价值观?
请注意,原帖者的图中有一个错误:(I-2u^H x)u
而不是(I-2uu^H)x
。这里的符号H
代表 Hermitian 转置,或共轭转置。在 Asymptote 中,u^Hx
只不过是标量积dot(u,x)
。
// http://asymptote.ualberta.ca/
import three;
size(8cm);
currentprojection=orthographic(2,3,-1,center=true,zoom=.9);
triple u=(0,0,1), x=(0,2,2.5);
triple uh=u;
real uhx=dot(uh,x);
triple A=x-uhx*u;
triple B=uhx*u;
triple C=x-2*uhx*u;
draw(B--x,gray);
draw(Label("$-(u^Hx)u$",Relative(.5),align=E),x--A,gray+dashed,Arrow3);
draw(Label("$-(u^Hx)u$",Relative(.5),align=E),A--C,gray+dashed,Arrow3);
draw(Label("$x-(u^Hx)u$",EndPoint,align=E),O--A,orange+1pt,Arrow3);
draw(Label("$(u^Hx)u$",EndPoint,align=W),O--B,gray+1pt,Arrow3);
draw(Label("$u$",EndPoint,align=W),O--u,gray+1pt,Arrow3);
draw(Label("$\left(I-2u^Hx\right)u$",EndPoint,align=S),O--C,blue+1pt,Arrow3);
draw(Label("$x$",EndPoint,align=NE),O--x,red+1pt,Arrow3);
draw(shift(-1.5A-1.5X)*surface(plane(4A,3X)),blue+opacity(.1));
// to see numeric values
write("u = ",u);
write("x = ",x);
write("<u,x> = ",uhx);
write("x - <u,x> u = ",A);
write("<u,x> u = ",B);
write("x - 2 <u,x> u = ",C);