# Closing a path with a “to” curve

The "oval" path in too sharp as you can see in the intersection with the horizontal line. How can i fix this problem?

\documentclass{article}
\usepackage{tikz}

\begin{document}

\begin{tikzpicture}[scale=0.3]
\draw (0,7.5)--(5,7.5);
\draw[smooth] (0,0) to[out=75,in=285] (0,7.5) to[out=255,in=105] (0,0)-- cycle;
\end{tikzpicture}

\end{document}


I'm tryng to make something like this:

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{patterns}

\begin{document}

\begin{tikzpicture}[scale=0.3]

\draw[smooth,pattern=north east lines] (0,0) to[out=75,in=285] (0,7.5)   to[out=255,in=105] (0,0)-- cycle;
\draw (0,-7.5) to[out=105,in=255] (0,0);

\draw (0,7.5)--(20,7.5);
\draw (0,-7.5)--(20,-7.5);

\end{tikzpicture}
\end{document}


-

You can use the builtin ellipse command in TikZ. Here you go:

\documentclass{article}
\usepackage{tikz}

\begin{document}

\begin{tikzpicture}[scale=0.3]
\draw (0,7.5)--(5,7.5);
\draw (0,3.75) ellipse (0.75 and 3.75);
\end{tikzpicture}

\end{document}


-

I'm not sure about what is the intended result.

1. If you want the curve to be "smooth" at the top and bottom, then drawing it with a pair of "unrelated" arcs won't work. For this, you need either use a ellipse (as other answer suggests), or define appropriate control points, or using your approach, be sure that the in and out angles at the tips guarantees that the tangent of the curve is horizontal at those points. I.e: they should be 0 or 180:

\begin{tikzpicture}[scale=0.3]
\draw (0,7.5)--(5,7.5);
\draw (0,0) to [out=180,in=180] (0,7.5) to[out=0,in=0] (0,0) -- cycle;
\end{tikzpicture}


If you want a different aspect ratio for the ellipse, you can play with the parameter looseness, which by default is 1. For example:

\begin{tikzpicture}[scale=0.3]
\draw (0,7.5)--(5,7.5);
\draw (0,0) to [out=180,in=180,looseness=0.5] (0,7.5) to[out=0,in=0, looseness=0.5] (0,0) -- cycle;
\end{tikzpicture}


produces:

2. If you want the curve to have "acute" tips, but you don't want those tips to extend beyond your horizontal line, then the problem is the kind of line join used. By default, tikz uses "miter join" and when two lines join into a corner with a small angle, the width of the lines cause the intersection of them occuring "past the corner". You can use line join=round to fix this problem.

\begin{tikzpicture}[scale=0.3]
\draw (0,7.5)--(5,7.5);
\draw[smooth, line join=round] (0,0) to[out=75,in=285] (0,7.5) to[out=255,in=105] (0,0)-- cycle;
\end{tikzpicture}


-

Using arcs:

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{patterns}

\begin{document}

\begin{tikzpicture}[scale=0.3]

\draw (20,8)--(0,8);
%
\draw (a) arc[start angle=-270,end angle = -90, x radius=1.5cm, y radius=4cm] --(20,-8);

\end{tikzpicture}
\end{document}


With bends:

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{patterns}

\begin{document}

\begin{tikzpicture}[scale=0.3,line join = round]

\draw (20,8)--(0,8);
\draw[pattern=north east lines] (0,8) to[bend left] (0,0)coordinate[pos=1](a) to[bend left] (0,8);
%
\draw (a) to[bend right] (0,-8) -- (20,-8);

\end{tikzpicture}
\end{document}


-