Direction field for dy/dx=-x/y

enter image description here

\documentclass{beamer}
\usepackage{pgfplots}
\usetikzlibrary{arrows.meta}
\begin{document}
\begin{frame}
\def\length{sqrt(1+(-x/y)^2)}
\begin{tikzpicture}
\begin{axis}[
domain=-3:3, 
view={0}{90},
title={$\displaystyle\frac{dy}{dx}=-\frac{x}{y}$},
xmin=-3,
xmax=3,
ymin=-3,
ymax=3,
ytick={-3,-2,-1,0,1,2,3}
]
\addplot3[gray, quiver={u={1/(\length)}, v={(-x/y)/(\length)}, scale arrows=0.1}, -{Stealth[width=2pt,length=2pt]},samples=24,domain=-3:3] {0};
\addplot[blue, samples=50, thick, no markers, domain=0:2*pi] ({cos(deg(x))},{sin(deg(x))});
\addplot[red, samples=50, thick, no markers, domain=0:2*pi] ({2*cos(deg(x))},{2*sin(deg(x))});
\addplot[orange, samples=50, thick, no markers, domain=0:2*pi] ({3*cos(deg(x))},{3*sin(deg(x))});
\end{axis}
\end{tikzpicture}
\end{frame}
\end{document}

I'm not sure if this is sufficient for you. The circles are drawn as parametric plots, i.e. something of the form \addplot ({r*cos(x)}, {r*sin(x)});

The gap between the arrows for x < 0 is caused by the fact that the coordinate (x,y) refers to the start of the arrow as far as I can see, and as the arrows point in opposite directions (see image above), you get a gap there, and overlap for x > 0. Reducing the scaling of the arrows a bit fixes the overlapping problem. For the above image the number of samples is reduced to 24, if you really need 40 samples then you need to scale the arrows more, e.g.

\addplot3[gray, quiver={u={1/(\length)}, v={(-x/y)/(\length)}, scale arrows=0.07}, -{Stealth[width=1pt,length=1pt]},samples=40,domain=-3:3] {0};

One way of getting vertical arrows at the x-axis is to add separate quivers with u=0,v=±1. Perhaps the arrow scaling could be different.

\documentclass{beamer}
\usepackage{pgfplots}
\usetikzlibrary{arrows.meta}
\begin{document}
\begin{frame}
\def\length{sqrt(1+(-x/y)^2)}
\begin{tikzpicture}
\begin{axis}[
domain=-3:3, 
view={0}{90},
title={$\displaystyle\frac{dy}{dx}=-\frac{x}{y}$},
xmin=-3,
xmax=3,
ymin=-3,
ymax=3,
ytick={-3,-2,-1,0,1,2,3}
]
\addplot3[gray, quiver={u={1/(\length)}, v={(-x/y)/(\length)}, scale arrows=0.07}, -{Stealth[width=1pt,length=1pt]},samples=20,domain=-3:3] {0};

\addplot3[gray, quiver={u={0}, v={1}, scale arrows=0.05}, -{Stealth[width=1pt,length=1pt]},samples=10,samples y=1,domain=-3:-0.17,y domain=0] {0};
\addplot3[gray, quiver={u={0}, v={-1}, scale arrows=0.05}, -{Stealth[width=1pt,length=1pt]},samples=10,samples y=1,domain=-3:-0.17,y domain=0] {0};

\addplot[blue, samples=50, thick, no markers, domain=0:2*pi] ({cos(deg(x))},{sin(deg(x))});
\addplot[red, samples=50, thick, no markers, domain=0:2*pi] ({2*cos(deg(x))},{2*sin(deg(x))});
\addplot[orange, samples=50, thick, no markers, domain=0:2*pi] ({3*cos(deg(x))},{3*sin(deg(x))});
\end{axis}
\end{tikzpicture}
\end{frame}
\end{document}

enter image description here


This is a solution that also addresses the problem of inconsistent spacing between arrows due to the fact that the quiver command in pgfplots places the tail of, rather than the center of, an arrow at each point of an equidistant grid.

To deal with the problem, one can first plot an arrow the usual way, and then plot a second arrow that points in a direction that is exactly opposite to that of the first, but without any arrowhead; that is, the second "arrow" is essentially just a line. Together, these two objects constitutes an arrow that points in the direction of the first arrow. This creates an illusion that the arrow is placed at the center of a point.

For example:

enter image description here

\begin{tikzpicture}[
    declare function = {f(\x) = -\x/\y;} % Define which function we're using
    ]
    \begin{axis}[
        zmax = 1,
        zmin = 0,
        xtick = {-1,-0.5,...,1},
        axis equal image = true, % Unit vectors for both axes have the same length
        view = {0}{90}
        ]
        \addplot3[% Arrows' first-half
            blue,
            -stealth,
            domain  = -1:1,
            samples = 20,
            quiver  = {
                u=1/(2*sqrt(1^2 + f(x)^2)),
                v=f(x)/(2*sqrt(1^2 + f(x)^2)),
                scale arrows=0.075,
                },
        ] (x,y,0);
        \addplot3[% Arrow's second-half
            blue,
            domain  = -1:1,
            samples = 20,
            quiver  = {
                u=-1/(2*sqrt(1^2 + f(x)^2)),
                v=-f(x)/(2*sqrt(1^2 + f(x)^2)),
                scale arrows=0.075,
                },
        ] (x,y,0);
        \addplot [domain=-180:180, samples=100, color=red, thick] ({0.75*cos(x)},{0.75*sin(x)});
    \end{axis}
\end{tikzpicture}

The solution was inspired by a Matlab code by Tobias von Petersdorff of the University of Maryland. Here is the link.