如何在 tikz 中绘制半椭圆?

如何在 tikz 中绘制半椭圆?

这是我目前的代码。我一直在努力在左侧绘制半椭圆。

\begin{tikzpicture}

\draw (-2,1) -- (2,1);
\draw (-2,0) -- (2,0);
\filldraw[color=black, fill=black!5, very thick](2,0.5) ellipse (0.25 and 0.5);
\filldraw[color=black, fill=black!5, very thick](-2,0.5) ellipse (0.25 and 0.5);

\end{tikzpicture}

代码结果

这就是我想要画的:

我想要的是

答案1

\documentclass[border=2mm,tikz]{standalone} 
\usetikzlibrary{patterns.meta}
\begin{document}
\begin{tikzpicture}[x radius=0.5,y radius=1,line join=round] 
 \draw[pattern={Lines[angle=45,distance=5pt]}] circle;
 \draw (0.5,0) node[right,blue]{$A$}
 (2,-1) -- (-2,-1) arc[start angle=270,end angle=90] -- (2,1)
 (2,0) circle;
 \path[red,-stealth] [shift={(2,0)}] foreach \x in {0,30,...,330} 
  {(10+\x:0.4 and 0.8) edge ++ (1,0)}
  (-4.5,0) edge ++ (-1,0) node[above left,blue]{$F$};
\end{tikzpicture}
\end{document}

在此处输入图片描述

相关内容