add tag
topnush
Consider the following slide.

```
\documentclass{beamer}
\usepackage{tikz}

\begin{document}


\begin{frame}[fragile]{}
\begin{center}
\begin{tikzpicture}
\draw[fill=blue!50] (0,0) ellipse (5cm and 1cm);
\node [circle, fill=red, left=2cm](s) {s};
\node [circle, fill=red, right=2cm](t) {t};
\end{tikzpicture}
\end{center}
\end{frame}

\end{document}  
```

How can I draw an S shaped curve between node s and t that I can label with some text in the middle.

Something like (but more beautiful):

![Screenshot from 2021-05-05 17-08-55.png](/image?hash=c6a3d200ea1586727992cf6e1963a7446cdb05cca54deea44da95ab740ca9e49)
Top Answer
user 3.14159
One option is to play with the `in` and `out` keys.
```
\documentclass{beamer}
\usepackage{tikz}
\usetikzlibrary{calc}
\begin{document}


\begin{frame}[fragile]{}
\begin{center}
\begin{tikzpicture}
\draw[fill=blue!50] (0,0) ellipse[x radius=5cm,y radius=1cm];
\node [circle, fill=red, left=2cm](s) {s};
\node [circle, fill=red, right=2cm](t) {t};
\draw (s) to[out=45,in=180] ($($(s)!0.5!(t)$)+(0,-0.5)$) 
 node[above=6mm] {$d_G(\nu_1,\nu_2)$}
 to[out=0,in=135] (t);
\end{tikzpicture}
\end{center}
\end{frame}
\end{document}  
```
![Screen Shot 2021-05-05 at 9.40.26 AM.png](/image?hash=9e1f64fb3be059588485d0a7b1723bfa6dae24d2ac746bf44c20ce1a0a297648)
Answer #2
joulev
As I said in the chat, a sine curve. Finding the right function might get pretty complicated if you place the nodes randomly though.

```
\documentclass[tikz,margin=3mm]{standalone}
\begin{document}
\begin{tikzpicture}
  \draw[fill=blue!50] (0,0) ellipse (5cm and 1cm);
  \draw plot[samples=50,domain=-2:2] (\x,{-.5*cos(deg(3*pi*\x/4))});
  \node[circle,fill=red,left=2cm,anchor=center] (s) {s};
  \node[circle,fill=red,right=2cm,anchor=center] (t) {t};
  \path (s) -- (t) node[midway,above] {midway};
\end{tikzpicture}
\end{document}
```

![image.png](/image?hash=993dd4e9db34b67585abe02df595098e5e177a102dddea4b142bfc998ddd8539)

Enter question or answer id or url (and optionally further answer ids/urls from the same question) from

Separate each id/url with a space. No need to list your own answers; they will be imported automatically.