![绘制与线正交的平面并在其上投影矢量](https://linux22.com/image/387266/%E7%BB%98%E5%88%B6%E4%B8%8E%E7%BA%BF%E6%AD%A3%E4%BA%A4%E7%9A%84%E5%B9%B3%E9%9D%A2%E5%B9%B6%E5%9C%A8%E5%85%B6%E4%B8%8A%E6%8A%95%E5%BD%B1%E7%9F%A2%E9%87%8F.png)
我想制作一个tikz
手绘的该图像版本,并将其包含在我的论文中
我具体遇到了两件事:
- 绘制垂直于的平面长期合同和洛斯
- 投射r在以原点为中心的平面上(给出矢量R) 和五在以为中心的平面上r(给出向量⟂)
这是我的代码
\documentclass[tikz, border=10pt]{standalone}
\usepackage{tikz, tikz-3dplot}
\usepackage{xcolor, graphicx}
\usepackage{bm}
\usetikzlibrary{arrows, calc, intersections}
\begin{document}
\begin{tikzpicture}[scale = 0.5]
% draw axes of frame
\draw [thin,->] (0,0,0) -- (5,0,0) node[below right] {\small$y$};
\draw [thin,->] (0,0,0) -- (0,5,0) node[above] {\small$z$};
\draw [thin,->] (0,0,0) -- (0,0,9) node[below left] {\small$x$};
% draw sphere to resemble the system
\shade [ball color = gray!40, opacity = 0.4] (0,0) circle (4cm);
% define coordinate of origin
\coordinate (C) at (0,0,0);
% define coordinate of O
\coordinate (O) at (20, -4, 4){};
% draw vector from origin to O
\draw[name path=C--O] (C) -- (O) node[below](){Observer};
\node[rotate=-13] at (12,-4) {$ltc$};
% define coordinate of S
\coordinate (S) at (3.6, 3.2, 2){};
% draw vector from origin to S
\draw [->, name path=C--S] (C) -- (S) node at (1.6,0.4) {$\bm{r}$};
% draw vector from O to S
\draw [name path=O--S] (O) -- (S);
\node [rotate=-25] at (11,-1.3) {$los$};
% draw orthogonal to segment C--O
\draw [thick, name path=C--R] (C) -- ($(C)!4cm!102:(O)$) node[right] at (0.2,2) {R};
\draw [->] (-0.5,0.5,0) arc (90:300:1 and 0.6) node[left] at (-1.4,-0.6) {$\theta$};
\coordinate (V) at (6,4,2);
\draw [->, thick] (S) -- (V) node[above right] {$\bm{v}$};
\draw [->] (5,3.5,2) arc (30:-35:1.4 and 0.8) node[right] at (4.3,2.3) {$\phi$};
\draw [->] (3.5,4,2) arc (90:180:0.6 and 0.8) node[left] at (2.3,3) {$\omega$};
\draw [<-, blue] (-0.8,-4.2) arc (180:270:1 and 0.8);
\node [blue] at (2.5,-5) {dwarf galaxy};
\end{tikzpicture}
\end{document}
我画了R通过旋转一条与路径正交的线C--O
,但这是不正确的。
我需要一个垂直于该路径的平面,通过原点和共面向量R,从原点延伸到洛斯。
是否有某种优雅而精确的方法可以做到这一点?
任何指示都非常感谢。谢谢
PS:你可能注意到我没有旋转框架。那是因为我搞不懂。我试着玩了一下,\tdplotsetmaincords{}{}
但它旋转轴的方式对我来说相当神秘。所以我放弃了,并采取了一个肮脏而快速的解决方案:简单地用不同的名字标记轴
答案1
我不明白什么角度欧米茄和西塔表明,除此之外,我想我已经用手复制了你画的东西
\documentclass[tikz, border = 10pt]{standalone}
\usepackage{tikz-3dplot}
\usetikzlibrary{arrows.meta, calc}
\usepackage{xcolor}
\usepackage{bm}
\usepackage[e]{esvect}
\begin{document}
\tdplotsetmaincoords{60}{125}
\begin{tikzpicture}[tdplot_main_coords]
\draw[-{Stealth[round, scale = 1.3]}] (0,0,0) -- (9, 0, 0) node[anchor = north east]{\small$x$};
\draw[-{Stealth[round, scale = 1.3]}] (0,0,0) -- (0, 7, 0) node[anchor = north west]{\small$y$};
\draw[-{Stealth[round, scale = 1.3]}] (0,0,0) -- (0, 0, 7) node[anchor = south]{\small$z$};
\shade [ball color = gray!40, opacity = 0.4] (0, 0) circle (3 cm); %% 3 cm is equivalently 3 in coordinate
\coordinate (C) at (0,0,0);
\coordinate (O) at (4, 20, -4){};
\coordinate (oext) at (-0.2, -1, --0.2){};
\coordinate (S) at (1, 2, 2){};
\coordinate (V) at (1, 4, 3);
\coordinate (R) at ({8 / 11}, {2 - (18 / 11)}, {2 + (6 / 11)});
\coordinate (vper) at ({31 / 41}, {4 - (60 / 41)}, {3 + (20 / 41)});
\coordinate (vpar) at ({51 / 41}, {2 + (60 / 41)}, {2 - (20 / 41)});
\coordinate (vii) at ({1 / 3}, {5 / 3}, {- 1 / 3});
\filldraw [black] (4, 20, -4) circle (1pt);
\draw (C) -- (O) node[anchor = west]{observer};
\draw (O) -- (S);
\draw [-{Stealth[round, scale = 1.3]}] (C) -- (S);
\node [anchor = east] at (0.8, 1.6, 1.6) {$\vv{\bm{r}}$};
\draw [-{Stealth[round, scale = 1.3]}, thick] (S) -- (V) node [above right] {$\vv{\bm{v}}$};
\draw [dashed] (C) -- (oext);
\node [rotate = -23, anchor = north] at (2, 10, -2) {$ltc$};
\node [rotate = -30, anchor = south] at (2.5, 11, -1) {$los$};
\coordinate (ltcbl) at (1, -0.4, -1){};
\coordinate (ltcbr) at (-1, 0, -1){};
\coordinate (ltctl) at (1, 0, 1){};
\coordinate (ltctr) at (-1, 0.4, 1){};
\draw [red] (ltcbl) -- (ltcbr) -- (ltctr) -- (ltctl) -- (ltcbl);
\coordinate (losbl) at (0, {2 - (1/6)}, 1){};
\coordinate (losbr) at (2, 1.5, 1){};
\coordinate (lostl) at (0, 2.5, 3){};
\coordinate (lostr) at (2, {2 + (1/6)}, 3){};
\draw [blue] (losbl) -- (losbr) -- (lostr) -- (lostl) -- (losbl);
\draw [-{Stealth[round, scale = 1.3]}, color = red, thick] (C) -- (R);
\draw [dashed] (R) -- (S);
\node [anchor = east] at (R) {$R$};
\draw [-{Stealth[round, scale = 1.3]}, color = blue, thick] (S) -- (vper);
\draw [dashed] (vper) -- (V);
\node [anchor = east] at ({36 / 41}, {3 - (30 / 41)}, {2.5 + (10 / 41)}) {$\vv{\bm{v}}_{\bot}$};
\draw [-{Stealth[round, scale = 1.3]}, color = blue, thick] (S) -- (vpar);
\draw [dashed] (vpar) -- (V);
\node [anchor = north] at ({46 / 41}, {2 + (30 / 41)}, {2 - (10 / 41)}) {$\vv{\bm{v}}_{eos}$};
\draw [green] ({46 / 41}, {2 + (30 / 41)}, {2 - (10 / 41)}) arc (85:155:1);
\node [green] at (1.2, 3.4, 2.3) {$\phi$};
\draw [dashed] (S) -- (vii) node [below] {$vii$};
\draw [{Stealth[round, scale = 1.3]}-, gray] (-0.8, -4.2, 0) arc (180:270:1 and 0.8);
\node [gray] at (2, -4, 0.5) {dwarf galaxy};
\end{tikzpicture}
\end{document}
输出如下
我想澄清几点
- 我将坐标系改为传统视图,这样使用起来更加方便。
- 由于您没有指定点
S
应该在哪里,所以我把它放在球体上。 - 为了方便起见,我选择球体的半径为3,这样它的平方就可以分解为1+4+4,都是平方数。
- 我认为绘制垂直于的平面
los
会使ltc
图片变得复杂,因此建议将其删除。