八边形轮廓线怎么画

八边形轮廓线怎么画

我需要绘制一个轮廓,用于一些与复杂积分相关的练习,称为八轮廓,如下图所示。对我来说,主要问题是获得自动相交周围的形状。祝你度过愉快的一周!

在此处输入图片描述

答案1

以下是如何在 TIKZ 中执行此操作的示例:

\documentclass[border=1cm]{standalone}
\usepackage{tikz}
\usetikzlibrary{decorations.markings}

\begin{document}
    
    
    \begin{tikzpicture}

        \draw[decoration={markings, mark=at position 0.25 with {\arrow{>}}},postaction={decorate},decoration={markings, mark=at position 0.75 with {\arrow{>}}},postaction={decorate}]  
        (-1,0) to[out=90, in=125, looseness=2] (1,0) to[out=-55, in=-90, looseness=2] (2.5,0);
        
        \draw[decoration={markings, mark=at position 0.25 with {\arrow{<}}},postaction={decorate},decoration={markings, mark=at position 0.75 with {\arrow{<}}},postaction={decorate}] 
        (-1,0) to[out=-90, in=-125, looseness=2] (1,0) to[out=55, in=90, looseness=2] (2.5,0);
        
        \draw[stealth-stealth] (0,-2) -- (0,4);
        \draw[stealth-stealth] (-2,0) -- (4,0);
        \filldraw [color=blue!50] (0,0) circle (2pt);
        \filldraw [color=blue!50] (2,0) circle (2pt);

        
    \end{tikzpicture}

    
\end{document}

在此处输入图片描述

相关内容