Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I want to draw the following diagram.

enter image description here

I have tried with the following Latex command:

\documentclass[12pt,twoside,a4paper]{book}
\usepackage{graphicx,wrapfig,tikz}
 \begin{document}

 \begin{tikzpicture}
 \draw (0,4) ellipse ( 2cm and .6cm);

  \draw (2,4) -- (2,0);
 \draw[fill] (0,0) circle (1pt);
 \end{tikzpicture}
 \end{document}

How can I draw this diagram using tikzpicture?

share|improve this question
1  
Welcome to TeX.SX! Please help us to help you and add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}. –  Christian Hupfer Aug 21 at 7:25
    
I would go for hobby. You can find an example in Draw a closed liquid-droped shaped curve with TikZ. –  Claudio Fiandrino Aug 21 at 7:33

1 Answer 1

Using hobby package (\usetikzlibrary{hobby}) and calc for operations with coordinates we get this (PGF/Tikz 3.0.x)

\documentclass[12pt,twoside,a4paper]{book}
\usepackage{graphicx,wrapfig,tikz}
\usetikzlibrary{calc,hobby} % To draw the smooth curve
 \begin{document}
\tikzset{
    circ/.pic={ % Defines a `circle` to mark the coordinates.
    \fill (0,0) circle (2pt);
    }
}
\begin{tikzpicture} 
\coordinate (a1) at (0,0);
\coordinate (a2) at (3.3,-0.3);
\coordinate (a3) at (4.5,0.2);
\coordinate (a4) at (2,1.5);
\coordinate (a5) at (3,3);
\coordinate (a6) at (2.4,3.2);
\coordinate (a7) at (1,2);
\coordinate (O) at ($(a1)-(1,2)$);
\draw[thick] (O)--($(a3|-O)+(1,0)$);
\foreach \i in {5,6,7} \draw[densely dotted] (a\i)-- (a\i|-O);
\begin{scope}
\clip[use Hobby shortcut] ([out angle=-90]a1)..(a2)..([in angle=-90]a3); 
\foreach \i in {5,6,7} \draw[red] (a\i)-- (a\i|-O);
\end{scope}
\begin{scope}
\clip[use Hobby shortcut] ([out angle=90]a3)..(a4)..(a5)..(a6)..(a7)..([in angle=90]a1);
\foreach \i in {5,6,7} \draw[red] (a\i)-- (a\i|-O);
\end{scope}
\draw[use Hobby shortcut,thick] ([out angle=-90]a1)..(a2)..([in angle=-90]a3); 
\draw[use Hobby shortcut,thick] ([out angle=90]a3)..(a4)..(a5)..(a6)..(a7)..([in angle=90]a1);
\foreach \i in {1,3} \draw (a\i)-- (a\i|-O);
\foreach \i in  {1,3,5,6,7} {\draw (a\i) pic {circ};} 
\end{tikzpicture}
\end{document}

enter image description here

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.