# How to draw a region of non-uniform electric field in TikZ?

How to draw this diagram in TikZ?

I'm sorry for not providing an minimal example here, because I am totally stuck from the very first. I can't find a solution for many sub-problems which occured during my attempts. Here are the most difficult ones:

1. The curved lines: They clearly should have the same center, but if I use that center, the height of the picture is extremely huge, which doesn't fit the page. If I use arc, I can avoid the unnecessary huge height, but it is too difficult to make the arcs concentric.
2. The right angle notations: I found a solution: draw a small square that has the dashed line and the curves as two sides of it. Of course I can't use \pic here (or can I?). But there are 8 such square here, so drawing such a large number of squares will make my code extremely long, which I don't like.
3. The curved arrows: I think in and out is good, but it is too hard for me to find the coordinates and find the tangency angles. I am not "sensitive" in controls enough to find the control points.

Can you help me? Thank you in advance!

• For the circles: Use \clip (boundaryone) rectangle (boundarytwo) (with correct boundary values) to clip your picture to the relevant part. For the right angles: TikZ provides for loops that can be used to automate it (maybe in combination with the intersections library). – TeXnician Feb 21 at 12:48

According to what I find you can get reasonable results by adjusting the looseness. (And you may draw the right angle symbols in a loop.)

\documentclass[tikz,border=3.14mm]{standalone}
\usetikzlibrary{arrows.meta,bending}
\begin{document}
\begin{tikzpicture}[scale=1.5,font=\sffamily]
\begin{scope}
\path[preaction={draw,thick},clip] (-4,3) rectangle (4,8);
\foreach \Y [count=\Z,evaluate=\Z as \Voltage using {int(440-\Z*40)}] in {1.2,1.4,...,2.2}
{\draw (0,0) circle ({exp(\Y)});
\node[rotate=-22.5,fill=white] at (67.5:{exp(\Y)}){\Voltage~V};}
\foreach \X in {60,75,...,120}
{\draw[dashed] (0,0) -- ++ (\X:10);
\foreach \Y in {1.2,1.4,...,2.2}
{\draw  ({\X-10/exp(\Y)}:{exp(\Y)}) -- ({\X-10/exp(\Y)}:{exp(\Y)+0.2})
-- ({\X}:{exp(\Y)+0.2});}}
\end{scope}
\draw[thick,-{Stealth[length=2mm,bend]}] (-5.5,5.5) -- (-4,5.5)
to[out=0,in=-110] (0.5,8.5) node[right]{A};
\draw[thick,-{Stealth[length=2mm,bend]}] (-5.5,5.5) -- (-4,5.5)
to[out=0,in=-105,looseness=1.3] (75:8.7) node[right]{B};
\draw[thick,-{Stealth[length=2mm,bend]}] (-5.5,5.5) -- (-4,5.5)
to[out=0,in=95,looseness=0.8] (90:2.7) node[left]{C};
\draw[thick,-{Stealth[length=2mm,bend]}] (-5.5,5.5) -- (-4,5.5)
to[out=0,in=75,looseness=1.5] (75:2.7) node[right]{D};
\draw[thick,{Circle}-{Stealth[length=2mm,bend]}] (-5.5,5.5) -- (-4.5,5.5)
node[midway,above]{$v$} node[midway,below,align=center]{charged\\ particle};
\end{tikzpicture}
\end{document}


I do not know how inhomogeneous your field is. One could definitely also draw the circles according to Coulombs law.

\documentclass[tikz,border=3.14mm]{standalone}
\usetikzlibrary{arrows.meta,bending}
\begin{document}
\begin{tikzpicture}[scale=1.5,font=\sffamily]
\begin{scope}
\path[preaction={draw,thick},clip] (-4,3) rectangle (4,8);
\foreach \Voltage in {440,400,...,200}
{\draw (0,0) circle ({4*(400/\Voltage)});
\node[rotate=-22.5,fill=white] at (67.5:{4*(400/\Voltage)}){\Voltage~V};}
\foreach \X in {60,75,...,120}
{\draw[dashed] (0,0) -- ++ (\X:10);
\foreach \Voltage in {440,400,...,200}
{\draw  ({\X-2*\Voltage/400}:{4*(400/\Voltage)}) --
({\X-2*\Voltage/400)}:{4*(400/\Voltage)+0.15})
-- ({\X}:{4*(400/\Voltage)+0.15});}}
\end{scope}
\draw[thick,-{Stealth[length=2mm,bend]}] (-5.5,5.5) -- (-4,5.5)
to[out=0,in=-110] (0.5,8.5) node[right]{A};
\draw[thick,-{Stealth[length=2mm,bend]}] (-5.5,5.5) -- (-4,5.5)
to[out=0,in=-105,looseness=1.3] (75:8.7) node[right]{B};
\draw[thick,-{Stealth[length=2mm,bend]}] (-5.5,5.5) -- (-4,5.5)
to[out=0,in=95,looseness=0.8] (90:2.7) node[left]{C};
\draw[thick,-{Stealth[length=2mm,bend]}] (-5.5,5.5) -- (-4,5.5)
to[out=0,in=75,looseness=1.5] (75:2.7) node[right]{D};
\draw[thick,{Circle}-{Stealth[length=2mm,bend]}] (-5.5,5.5) -- (-4.5,5.5)
node[midway,above]{$v$} node[midway,below,align=center]{charged\\ particle};
\end{tikzpicture}
\end{document}


• It is wonderful. My best compliments. – Sebastiano Feb 21 at 19:53