I'm trying to draw the following figures using TikZ, and I've found some issues :
Here's my attempt :
\begin{tikzpicture}
\def\a{2}
\def\b{1}
\def\h{6}
\draw[->] (0,0)--(-\a,0) node[midway, above]{$r$};
\filldraw (0,0) circle(1pt);
\filldraw (0,\h) circle(1pt);
\draw[dashed, ->] (0,\h)--(0,\h+2) node[left] {$d\vec{S}$};
\draw[blue, thick] (\a,0)--(\a,\h) (-\a,0)--(-\a,\h);
\draw[dashed,blue, thick] (\a,0) arc [x radius=\a, y radius=\b, start angle=0, end angle=180];
\draw[blue, thick] (-\a,0) arc [x radius=\a, y radius=\b, start angle=180, end angle=360];
\draw[blue, thick] (0,\h) ellipse (\a cm and \b cm);
\draw[->] (0,\h)--(3,\h) node[above, midway] {$\vec{E}$};
\draw[ultra thick] (0,0)--(0,\h) node[midway, left] {$\lambda >0$};
\end{tikzpicture}
And I need to draw some other figures, such as :
My problem is always that surface portion. Any thoughts ?
Best Answer
Old notation:
circle(1pt)
and new notation:circle[radius=1 pt]
. You make me anxious when you mix them.