如何在 tikz 中使輪廓變形

如何在 tikz 中使輪廓變形

我試圖弄清楚如何將沿著 A 到 K 的曲線與最右上角的點連接起來。換句話說,我想在情節的右側部分留下更多的圓圈;現在我有一條沿著 K 到 H(...) 的直線,但更喜歡從 K 到 H(...) 的曲線。我該怎麼做呢?另外,如果我想要在該點上方再畫一個小半圓,例如x=-1.5,y=.2,以及在x=-1.5,y=.2 下方,有什麼方法可以做到這一點而不破壞它影像?謝謝!到目前為止,我有一些看起來像這樣的東西(不完全是,但很接近):

\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{calc,decorations.markings,positioning}
\begin{document}
        \begin{tikzpicture}
        %configurable parameters
        \def\gap{0.4}
        \def\bigradius{4}
        \def\littleradius{1}
        %axes
        \draw[line width=2pt,->](-1.5*\bigradius,0) -- (1.5*\bigradius,0)
        (0,-1.5*\bigradius) -- (0,1.5*\bigradius);
        \draw[line width=2pt,->] (0,0)--(45:\littleradius);
        \draw[line width=2pt,->](0,0) -- (135:\bigradius); \node[above
        right] at (45:\littleradius/1.5) {\large\bf{$\varepsilon$}};
        \draw[line width=1pt,decoration={markings,
            mark=at position 0.07 with{\arrow[line width =2pt]{>}},%{latex}},
            mark=at position 0.17 with{\arrow[line width =2pt]{>}},
            mark=at position 0.27 with{\arrow[line width =2pt]{>}},
            mark=at position 0.35 with {\arrow[line width =2pt]{>}},%{latex}},
            mark=at position 0.47 with{\arrow[line width =2pt]{>}},
            mark=at position 0.53 with{\arrow[line width =2pt]{>}},%{latex}},
            mark=at position 0.6 with {\arrow[line width =2pt]{>}},%{latex}},
            mark=at position 0.65 with {\arrow[line width =2pt]{>}},%{latex}},
            mark=at position 0.7 with{\arrow[line width =2pt]{>}},
            mark=at position 0.8 with{\arrow[line width =2pt]{>}},
            mark=at position 0.85 with{\arrow[line width =2pt]{>}},
            mark=at position 0.955 with{\arrow[line width =2pt]{>}}},%{latex}}},
        postaction={decorate}]
        let
        \n1={asin(\gap/2/\bigradius)},
        \n2={asin(\gap/2/\littleradius)}
        in (180-\n1:\bigradius) -- (-180-\n2:\littleradius)
        arc(180-\n2:-180+\n2:\littleradius)--(-180+\n1:\bigradius)
        arc(-180+\n1:-90:\bigradius)--(3,-4)--(3,4)--(0,4)arc(90:(180-\n1):\bigradius);
        \coordinate (T) at (135:2); \node[above] at (T){$T$}; 
        \coordinate (H) at (1.5*\bigradius,0); \node[below] at (H){\Large\bf {x}};
        \coordinate (J) at (0,1.5*\bigradius); \node[left] at (J){$\Large\bf y$}; 
        \coordinate (C) at (\littleradius,0); \node[below right] at (C) {\Large\bf {C}};
        \coordinate (D) at ({180-asin(\gap/2/\littleradius)}:1); \node[above left] at (D) {$ \Large\bf B$}; 
        \coordinate (E) at ({-180+asin(\gap/2/\littleradius)}:1); \node[below left] at (E) {$\Large\bf D$}; 
        \coordinate (F) at ({180-asin(\gap/2/\bigradius)}:\bigradius); \node[above left] at (F) {$\Large\bf A$}; 
        \coordinate (G) at ({-180+asin(\gap/2/\bigradius)}:\bigradius); \node[below left] at (G) {$\Large\bf  E$}; 
        \coordinate (P) at (0,-4); \node[below right] at (P) {$\Large\bf F$}; \coordinate(Q) at (3,-4); \node[right] at (Q) {$\Large\bf G(\gamma-iT)$}; 
        \coordinate (R) at (3,4); \node[right] at (R) {$\Large\bf H(\gamma+iT)$}; 
        \coordinate (S) at (0,4);\node[above right] at (S) {$\Large\bf K$};
        \end{tikzpicture}
\end{document}

在此輸入影像描述

這就是我正在尋找的: 在此輸入影像描述

答案1

我只是改變了路徑,以便它通過點(45:\bigradius)

let
        \n1={asin(\gap/2/\bigradius)},
        \n2={asin(\gap/2/\littleradius)}
        in (180-\n1:\bigradius) -- (-180-\n2:\littleradius)
        arc(180-\n2:-180+\n2:\littleradius)--(-180+\n1:\bigradius)
        arc(-180+\n1:-45:\bigradius)--(45:\bigradius)arc(45:(180-\n1):\bigradius);

螢幕截圖

\documentclass[border=5mm]{standalone}
\usepackage{tikz}
\usetikzlibrary{calc,decorations.markings,positioning}
\begin{document}
        \begin{tikzpicture}
        %configurable parameters
        \def\gap{0.4}
        \def\bigradius{4}
        \def\littleradius{1}
        %axes
        \draw[line width=2pt,->](-1.5*\bigradius,0) -- (1.5*\bigradius,0)
        (0,-1.5*\bigradius) -- (0,1.5*\bigradius);
        \draw[line width=2pt,->] (0,0)--(45:\littleradius);
        \draw[line width=2pt,->](0,0) -- (135:\bigradius); \node[above
        right] at (45:\littleradius/1.5) {\large\bf{$\varepsilon$}};
        \draw[line width=1pt,decoration={markings,
            mark=at position 0.07 with{\arrow[line width =2pt]{>}},%{latex}},
            mark=at position 0.17 with{\arrow[line width =2pt]{>}},
            mark=at position 0.27 with{\arrow[line width =2pt]{>}},
            mark=at position 0.35 with {\arrow[line width =2pt]{>}},%{latex}},
            mark=at position 0.47 with{\arrow[line width =2pt]{>}},
            mark=at position 0.53 with{\arrow[line width =2pt]{>}},%{latex}},
            mark=at position 0.6 with {\arrow[line width =2pt]{>}},%{latex}},
            mark=at position 0.65 with {\arrow[line width =2pt]{>}},%{latex}},
            mark=at position 0.7 with{\arrow[line width =2pt]{>}},
            mark=at position 0.8 with{\arrow[line width =2pt]{>}},
            mark=at position 0.85 with{\arrow[line width =2pt]{>}},
            mark=at position 0.955 with{\arrow[line width =2pt]{>}}},%{latex}}},
        postaction={decorate}]
        let
        \n1={asin(\gap/2/\bigradius)},
        \n2={asin(\gap/2/\littleradius)}
        in (180-\n1:\bigradius) -- (-180-\n2:\littleradius)
        arc(180-\n2:-180+\n2:\littleradius)--(-180+\n1:\bigradius)
        arc(-180+\n1:-45:\bigradius)--(45:\bigradius)arc(45:(180-\n1):\bigradius);
        \coordinate (T) at (135:2);
         \node[above] at (T){$T$}; 
        \coordinate (H) at (1.5*\bigradius,0);
         \node[below] at (H){\Large\bf {x}};
        \coordinate (J) at (0,1.5*\bigradius);
         \node[left] at (J){$\Large\bf y$}; 
        \coordinate (C) at (\littleradius,0);
         \node[below right] at (C) {\Large\bf {C}};
        \coordinate (D) at ({180-asin(\gap/2/\littleradius)}:1);            \node[above left] at (D) {$ \Large\bf B$}; 
        \coordinate (E) at ({-180+asin(\gap/2/\littleradius)}:1);           \node[below left] at (E) {$\Large\bf D$}; 
        \coordinate (F) at ({180-asin(\gap/2/\bigradius)}:\bigradius); 
        \node[above left] at (F) {$\Large\bf A$}; 
        \coordinate (G) at ({-180+asin(\gap/2/\bigradius)}:\bigradius); 
        \node[below left] at (G) {$\Large\bf  E$}; 
        \coordinate (P) at (0,-4);
        
         \node[below right] at (P) {$\Large\bf F$};
         \coordinate(Q) at (3,-4);
        \node[right] at (Q) {$\Large\bf G(\gamma-iT)$}; 
        \coordinate (R) at (3,4); 
        \node[right] at (R) {$\Large\bf H(\gamma+iT)$}; 
        \coordinate (S) at (0,4);
        \node[above right] at (S) {$\Large\bf K$};
        \end{tikzpicture}
\end{document}

相關內容