如何用弯线和圆角闭合抛物线?

如何用弯线和圆角闭合抛物线?

使用 tikz,我需要用弯线(远离抛物线)和连接抛物线的线端(角是圆的)来闭合抛物线。在此处输入图片描述

图像是垂直的。整个图需要是水平的。轴不是必需的。以下是我的尝试:

        \begin{tikzpicture}
        %first attempt
        \draw[rotate=270] [rounded corners=0.9cm] (0,0)--(1,1.732)[rounded corners=0.1cm]--(2,0)--cycle ;
        %second attempt
        \coordinate (O) at (0,0,0);
        \coordinate (A) at (0,3,0);
        \draw[color=red] (O) to [bend left=10] (A);
        \draw[rotate=90] (-1,1) parabola bend (0,0) (1,1);  
        \end{tikzpicture}

答案1

如果我正确理解了你的问题,那么你之后还会遇到这样的事情吗?

在此处输入图片描述

\documentclass[margin=3mm]{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=1.16}
\usetikzlibrary{backgrounds,
                fillbetween,
                intersections,
                }

\begin{document}
     \begin{tikzpicture}
\draw[thin,<->]  (-2.5,0) node[left] {$g_\downarrow(E)$} -- + (5,0) node[right] {$g_\uparrow(E)$};
\draw[thin, ->] (0,-0.5) -- + (0,6) node[above] {$E$};
%
\draw[thick, name path=A]  plot[domain=-2:2,samples=41] (\x,\x*\x+1) ;
\draw[name path=B]  (-2.5,4) -- + (5,0);
%
\draw [name path=C,
       name intersections={of=A and B, by={a,b}}] (a) -- (b);
\scoped[on background layer]
    \tikzfillbetween[of=A and C]{orange!30};
    \end{tikzpicture}
\end{document}

编辑: 显然我误解了这个问题。以下更正确吗?

\documentclass[tikz, margin=3mm]{standalone}

\begin{document}
     \begin{tikzpicture}
\draw[thin,<->] (0,-2.5) node[below] {$g_\downarrow(E)$} -- + (0,5) node[above] {$g_\uparrow(E)$};
\draw[thin, ->] (-0.5,0) -- + (6,0) node[right] {$E$};
%
\draw [ultra thick, red, rounded corners]
       plot[domain=-sqrt(3):sqrt(3),samples=41] (\x*\x+1,\x) -- cycle;% vertical lines is on distance of 3 units
    \end{tikzpicture}
\end{document}

在此处输入图片描述

相关内容