교차점을 사용하지 않고 장식 표시를 사용하여 폐곡선 표시(TikZ)

교차점을 사용하지 않고 장식 표시를 사용하여 폐곡선 표시(TikZ)

{Latex[length=4mm, cyan]}내 닫힌 곡선을 다음과 같이 표시하고 싶습니다.이것. 일반적으로 곡선을 표시하기 위해 교차점을 사용한 다음 새로운 사용자 정의 표시를 표시하고 isosceles triangle시행착오를 거쳐 회전 및 이동합니다. 그러나 그것은 효율적이지 않습니다. decorations.marking화살표 위치만 조정하면 사용하기 효율적이기 때문에 or else 같은 간단한 것을 사용하고 싶습니다 . 하지만 곡선이 닫혀 있기 때문에 를 사용할 때 오류가 많이 발생했습니다 decorations.markings. 가능합니까? 당신의 지식을 공유해주세요. 미리 감사드립니다.

내 MWE는 다음과 같습니다.

\documentclass[tikz, border=1mm]{standalone}
\usetikzlibrary{arrows.meta, decorations.markings}
\begin{document}
    \begin{tikzpicture} 
        \begin{scope}[>={Stealth[length=4mm]}]
            \draw[<->, thick] (-4,0)--(4,0) node[below,shift={(-.2,-.2)}]{\Large $x$};
            \draw[<->, thick] (0,-4)--(0,4) node[left, shift={(-.1,-.2)}]{\Large $y$};
        \end{scope}
        \begin{scope}[]
            \draw[line width=1.5pt] (0,0) circle [radius=3cm];
            \draw [red, line width=1.3pt]
            (.1,.4) .. controls (1.2,1.8) and (.4,2.3) .. (-.5,1.9)
            .. controls (-1.2,1.3) and (-1.8,1.5) .. (-2,1.4) 
            to[out=180,in=180] (-2,.2) 
            .. controls (-1.8,.1) and (0,.1) .. (.1,.4) -- cycle;
        \end{scope}
    \end{tikzpicture}
\end{document}

답변1

각 경로에 대한 장식을 정의하고 mark해당 장식을 호출한 후 해당 장식과 관련된 번호를 사용하여 화살표 위치를 설정할 수 있습니다.

    \documentclass[border=1mm]{standalone}
    \usepackage[dvipsnames]{xcolor}
    \usepackage{tikz}
    \usetikzlibrary{arrows.meta, decorations.markings}
    \begin{document}
    \begin{tikzpicture} 
    \begin{scope}[>={Stealth[length=4mm]}]
    \draw[<->, thick] (-4,0)--(4,0) node[below,shift={(-.2,-.2)}]{\Large $x$};
    \draw[<->, thick] (0,-4)--(0,4) node[left, shift={(-.1,-.2)}]{\Large $y$};
    \end{scope}
    \begin{scope}[thick,decoration={
        markings,
        mark=at position 0.35 with {\arrow[Cyan]{<}}}]
    \draw[line width=1.5pt, postaction={decorate}] (0,0) circle [radius=3cm];
    \end{scope}
    \begin{scope}[thick,decoration={
        markings,
        mark=at position 0.65 with {\arrow[Cyan]{>}}}]
    \draw [red, line width=1.3pt, postaction={decorate}]
    (.1,.4) .. controls (1.2,1.8) and (.4,2.3) .. (-.5,1.9)
    .. controls (-1.2,1.3) and (-1.8,1.5) .. (-2,1.4) 
    to[out=180,in=180] (-2,.2) 
    .. controls (-1.8,.1) and (0,.1) .. (.1,.4) -- cycle;
    \end{scope}
    \end{tikzpicture}
    \end{document}

여기에 이미지 설명을 입력하세요

관련 정보