9

I need to draw the following figure : enter image description here

I have used the following code to get it :

\documentclass{article}
\usepackage{tikz}

\begin{document}
\begin{tikzpicture}
\draw (2,2) circle (3cm);
\draw (2,2) ellipse (3cm and 1cm);
\end{tikzpicture}
\end{document}    

which produces :

enter image description here

How can I draw my desired figure using tikzpicture ?

Is there any way to draw an arbitrary curve with some portion of it is dotted?

Soumitra Sen
  • 2,995
  • 1
    Would this be helpful? http://tex.stackexchange.com/q/42812/34618 and related links there. – Jesse Mar 22 '14 at 07:01

2 Answers2

9

I have drawn the curve in another way below :

\documentclass{article}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\draw (0,0) circle (3cm);
\draw (-3,0) arc (180:360:3cm and 1cm);
\draw[dashed] (-3,0) arc (180:0:3cm and 1cm);

\end{tikzpicture}
\end{document}  

enter image description here

Soumitra Sen
  • 2,995
7

In your case, it is very simple to draw the ellipse twice, and clip the solid part, so only half of it is shown.

\documentclass{article}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\draw (2,2) circle (3cm);
\draw[dashed] (2,2) ellipse (3cm and 1cm);
\clip (-1.1,2) rectangle (5.1 cm,0.9 cm);
\draw (2,2) ellipse (3cm and 1cm);
\end{tikzpicture}
\end{document}

result