TikZ:可以将节点放置在 pos = .5 处,然后将坐标放置在线的末尾吗?

TikZ:可以将节点放置在 pos = .5 处,然后将坐标放置在线的末尾吗?

如标题所说,一个节点和一个坐标能放在同一条线上吗?

\documentclass{standalone}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
  \coordinate (P1) at (-2, 0);
  \coordinate (P2) at (2, 0);
  \draw (P1) -- (P2);
  \draw[-latex] (P1) -- ++(-88.2036:1.75cm) node[scale = .75, pos = .5,
  fill = white, shape = circle, inner sep = 0cm] {\(\nu_2\)};
  \draw[-latex](P1) -- ++(-20:5cm) node[scale = .75, pos= .5,
  fill = white, inner sep = 0cm, shape = circle] {\(v_2 = 12.9005\)};
\end{tikzpicture}
\end{document}

我可以在末尾添加坐标吗(P1) -- ++(-88.2036:1.75cm)?我通过搜索或在手册中找不到任何内容。

答案1

您可以直接在节点之后或之前添加坐标。

代码

\documentclass{standalone}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
  \coordinate (P1) at (-2, 0);
  \coordinate (P2) at (2, 0);
  \draw (P1) -- (P2);
  \draw[-latex] (P1) -- ++(-88.2036:1.75cm)
     node[scale = .75, pos = .5, fill = white, shape = circle, inner sep = 0cm] {\(\nu_2\)}
     coordinate (here);
  \draw[-latex] (P1) -- ++(-20:5cm)
     coordinate (there)
     node[scale = .75, pos= .5, fill = white, inner sep = 0cm, shape = circle] {\(v_2 = 12.9005\)};
  \draw[blue] (here) -- (there);
\end{tikzpicture}
\end{document}

输出

在此处输入图片描述

相关内容