2

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?

2

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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