How to draw the following image in TikZ?

This draws it as two objects.

\documentclass[border=2mm,tikz]{standalone}
\begin{document}
    \begin{tikzpicture}
    \draw (90:0.2) arc(90:430:0.5 and 0.2);
    \draw[dash pattern=on 7pt off 3pt on 20pt] (-110:0.5) -- ++ (70:1);
    \end{tikzpicture}
\end{document}

enter image description here

If you are bothered by having to tune the dash pattern, but are fine with overpainting things in white, you can use this.

\documentclass[border=2mm,tikz]{standalone}
\begin{document}
    \begin{tikzpicture}
    \draw (-110:0.5) -- ++ (70:1);
    \draw[preaction={draw,white,line width=4pt}] (90:0.2) arc(90:430:0.5 and 0.2);
    \end{tikzpicture}
\end{document}

enter image description here

Still 2 objects.


You can draw it with a single path !

\documentclass[tikz]{standalone}
\newcommand\singlepath[2]{% #1: a, #2: b (radii of ellipse)
  ++(70:#1 and #2) arc(70:-270:#1 and #2)
  ++(-90:#1 and #2) -- ++(80:2*#1 and 2*#2)
  ++(-100:3.3*#1 and 3.3*#2) -- ++(-100:2*#1 and 2*#2);
}
\begin{document}
\begin{tikzpicture}
  \draw[line width=1pt] (0,0)   \singlepath{1}{.3};
  \draw[red]            (2.5,0) \singlepath{1}{.2};
  \draw[dashed,blue]    (4.5,0) \singlepath{.5}{.3};
\end{tikzpicture}
\end{document}

enter image description here

Tags:

Draw

Tikz Pgf