答案1
大多数线条(0,0)
以箭头开始和结束,edge
在这种情况下,s 更合适。s 可以edge
让您更好地控制颜色、行尾等,而无需重复命令。它们还允许在库label
的帮助下使用 s quotes
。不过,标签语法完全不同。它们采用以下语法[<edge options> <"label"> <label options>].
\documentclass[tikz,border=2pt]{standalone}
\usetikzlibrary{calc,angles,quotes,bending}
\usepackage{bm}
\begin{document}
\begin{tikzpicture}[>= latex, line width=.7pt]
\path (70:2.5) node (x) [circle,fill=gray,inner sep=1pt] {}
(30:3.5) node (x')[circle,fill=gray,inner sep=1pt] {}
(0,0) coordinate (o) (0,3) coordinate (z) (-2.5,.5) coordinate (xnew);
\path[->] (o) edge ["$y$" below, pos=1] (3,0)
edge ["$z$" left, pos=1] (z)
edge ["$x$" left, pos=1] (225:2)
edge [blue, "$\color{black}\bm{x}$" right] (x)
edge [blue, "$\color{black}\bm{x'}$" right] (x')
edge [red, "$\bm{x-x'}$" black,pos=.3,sloped] (xnew)
(x') edge [blue] ++(0,10pt)
edge [red, "$\bm{x-x'}$" above,sloped] (x)
(x) edge [blue] ++(0,10pt);
\pic [draw, ->, "$\theta$"] {angle = z--o--xnew};
\end{tikzpicture}
\end{document}
答案2
\documentclass[crop,tikz]{standalone}
\usepackage{bm}
\usetikzlibrary{calc}
\usetikzlibrary{angles}
\usetikzlibrary{quotes}
\newcommand{\vect}[1]{\bm{#1}}
\begin{document}
\begin{tikzpicture}[outer sep = 3pt]
% coordinates
\coordinate (O) at (0, 0);
\coordinate (X) at ($ (O) + (225:3) $);
\coordinate (Y) at ($ (O) + (0:4) $);
\coordinate (Z) at ($ (O) + (90:3) $);
\coordinate (x) at ($ (O) + (70:3) $);
\coordinate (x') at ($ (O) + (20:3.5) $);
\coordinate (xnew) at ($ (x) - (x') $);
% axis
\draw[black, ->] (O) -- (X) node[below]{$x$};
\draw[black, ->] (O) -- (Y) node[right]{$y$};
\draw[black, ->] (O) -- (Z) node[left]{$z$};
% particles
\fill[gray] (x) circle (0.1) (x') circle (0.1);
% vectors
\draw[blue, thick, ->] (O) -- (x) node[left, midway]{$\vect{x}$};
\draw[blue, thick, ->] (O) -- (x') node[right, midway]{$\vect{x}'$};
\draw[red, thick, ->] (x') -- (x) node[right, midway]{$\vect{x} -
\vect{x}'$};
\draw[red, thick, ->] (O) -- (xnew) node[left, midway]{$\vect{x} -
\vect{x}'$};
\pic [draw = black, ->, angle eccentricity=1.5, "$\theta$"] {angle = Z--O--xnew};
\end{tikzpicture}
\end{document}
答案3
一个非常简单的方法是在 GeoGebra 中绘制它(可在此处下载免费软件:https://www.geogebra.org),然后将其导出为 TikZ,最后将 TikZ 图形合并到 LaTeX 中(可以在此处找到在 LaTeX 中显示 TikZ 图形的示例:https://en.wikibooks.org/wiki/LaTeX/PGF/TikZ)。可能直接自己在 TikZ 中执行此操作会得到更好的输出,但如果您不习惯 TikZ,这将比 GeoGebra 选项花费更多时间 :)
答案4
作为起点,如果您选择tikz
绘图工具:
\documentclass[tikz,border=3mm]{standalone}
\usetikzlibrary{angles, arrows.meta, quotes}
\usepackage{siunitx}
\begin{document}
%%%% se-phasor
\begin{tikzpicture}[
> = Straight Barb,
phasor/.style = {very thick,-{Stealth}},
angles/.style = {draw, <->, angle eccentricity=1,
right, angle radius=7mm}
]
% coordinates
\draw[->] (-0.5,0) -- (4,0) coordinate (x) node[below left] {$Re$};
\draw[->] (0,-1.5) -- (0,2) node[below left] (y) {$Im$};
% phasors
\draw[phasor] (0,0) -- (300:1.5) coordinate (i) node[right] {I};
\draw[phasor] (0,0) -- ( 30:2.5) coordinate (v) node[right] {V};
% angles drawn by pic
\coordinate (X) at (0,0);
\draw
pic["$\theta=\phi-\SI{90}{\degree}$",angles] {angle=i--X--x}
pic["$\phi$",angles] {angle=x--X--v}
;
\end{tikzpicture}
\end{document}
(这是我的一个很老的答案,现在我无法在网站上找到它)。当然,它不等于你的图像(它是坏的副本,几乎看不见)。