\documentclass[12pt]{article}
\usepackage{syntonly}
\usepackage{geometry}
\usepackage{caption}
\usepackage{subcaption}
\usepackage{tikz}
\usetikzlibrary{arrows.meta,
positioning}
\tikzset{node distance = 13mm and 11mm,
C/.style = {circle,draw, fill=blue!20,
minimum size=1cm, inner sep=0pt},
dot/.style = {circle, fill=black, inner sep=2pt,
node contents={} },
}
\begin{document}
\begin{figure}[ht]
\begin{subfigure}[b]{0.3\textwidth}
\caption{}
\label{subfig:1}
\begin{tikzpicture}
\node (j) [C, label=$j$] {};
\node [dot];
\node (i) [C, below right = of j, label=below:$i$] {};
\node (k) [C, above right = of i, label=$k$] {};
%
\draw[thick] (i) -- node {$y_i$}(i |- j) % <---
(j.center) -- node {$x_i$}(k);
\end{tikzpicture}
\end{subfigure}
\hfill
\begin{subfigure}[b]{0.3\textwidth}
\caption{}
\label{subfig:2}
\begin{tikzpicture}
\node (j) [C, label=$j$] {};
\node [dot];
\node (k) [C, below right = of j, label=below:$k$] {};
\node (i) [C, above right = of k, label=$i$] {};
%
\draw[thick] (k) -- node {$y_k$}(k |- j) % <---
(j.center) -- node {$x_k$}(i);
\end{tikzpicture}
\end{subfigure}
\hfill
\begin{subfigure}[b]{0.3\textwidth}
\caption{}
\label{subfig:3}
\begin{tikzpicture}
\node (i) [C, label=$i$] {};
\node [dot];
\node (j) [C, below right = of i, label=below:$j$] {};
\node (k) [C, above right = of j, label=$k$] {};
%
\draw[thick] (j) -- node {$y_j$}(j |- i) % <---
(i.center) --node {$x_j$} (k);
\end{tikzpicture}
\end{subfigure}
\caption{Jacobi coordinates for a three-body system}
\label{fig:jacobi}
\end{figure}
\end{document}
答案1
这就是你想要的吗?
\documentclass[12pt]{article}
\usepackage{syntonly}
\usepackage{geometry}
\usepackage{caption}
\usepackage{subcaption}
\usepackage{tikz}
\usetikzlibrary{arrows.meta,
positioning}
\tikzset{node distance = 13mm and 11mm,
C/.style = {circle,draw, fill=blue!20,
minimum size=1cm, inner sep=0pt},
Cj/.style = {circle,draw, fill=blue!20,
minimum size=1.4cm, inner sep=0pt},
dot/.style = {circle, fill=black, inner sep=2pt,
node contents={} },
}
\begin{document}
\begin{figure}[ht]
\begin{subfigure}[t]{0.3\textwidth}
\caption{}
\label{subfig:1}
\begin{tikzpicture}
\node (j) [Cj, label=$j$] {};
\node [dot];
\node (i) [C, below right = of j, label=below:$i$] {};
\node (k) [C, above right = of i, label=$k$,yshift=5pt] {};
%
\draw[thick] (i) -- node[left] {$y_i$}(i |- j) % <---
(j.center) -- node[midway,above,xshift=7pt] {$x_i$}(k);
\end{tikzpicture}
\end{subfigure}
\hfill
\begin{subfigure}[t]{0.3\textwidth}
\caption{}
\label{subfig:2}
\begin{tikzpicture}
\node (j) [Cj, label=$j$] {};
\node [dot];
\node (k) [C, below right = of j, label=below:$k$] {};
\node (i) [C, above right = of k, label=$i$,yshift=5pt] {};
%
\draw[thick] (k) -- node[left] {$y_k$}(k |- j) % <---
(j.center) -- node[midway,above,xshift=7pt] {$x_k$}(i);
\end{tikzpicture}
\end{subfigure}
\hfill
\begin{subfigure}[t]{0.3\textwidth}
\caption{}
\label{subfig:3}
\vspace{7pt}
\begin{tikzpicture}
\node (i) [C, label=$i$] {};
\node [dot];
\node (j) [Cj, below right = of i,label=below:$j$] {};
\node (k) [C, above right = of j, label=$k$] {};
%
\draw[thick] (j) -- node[left] {$y_j$}(j |- i) % <---
(i.center) --node[midway,above,xshift=7pt] {$x_j$} (k);
\end{tikzpicture}
\end{subfigure}
\caption{Jacobi coordinates for a three-body system}
\label{fig:jacobi}
\end{figure}
\end{document}