짧은 사인파 기호와 유사하도록 사인 곡선이 있는 원형 노드를 그립니다.

짧은 사인파 기호와 유사하도록 사인 곡선이 있는 원형 노드를 그립니다.

TikZ에서 이 작업을 수행하는 방법:
아래 링크에 표시된 다이어그램과 같이 짧은 사인파 기호와 유사한 사인 곡선이 있는 원형 노드를 그리고 싶습니다. 원을 그릴 수는 있지만 사인 곡선을 안에 넣는 방법을 모르겠습니다. 다이어그램

답변1

이를 수행하는 간단한 방법은 path picture. 추가 마법을 사용하면 경로 그림을 그림의 (-1,-1)왼쪽 하단 모서리와 (1,1)오른쪽 상단 모서리 로 설정할 수 있습니다 . 이렇게 하면 경로 그림 요소를 지정하는 것이 매우 간단해집니다.

\documentclass[tikz,border=5]{standalone}
\tikzset{%
  do path picture/.style={%
    path picture={%
      \pgfpointdiff{\pgfpointanchor{path picture bounding box}{south west}}%
        {\pgfpointanchor{path picture bounding box}{north east}}%
      \pgfgetlastxy\x\y%
      \tikzset{x=\x/2,y=\y/2}%
      #1
    }
  },
  sin wave/.style={do path picture={    
    \draw [line cap=round] (-3/4,0)
      sin (-3/8,1/2) cos (0,0) sin (3/8,-1/2) cos (3/4,0);
  }},
  cross/.style={do path picture={    
    \draw [line cap=round] (-1,-1) -- (1,1) (-1,1) -- (1,-1);
  }},
  plus/.style={do path picture={    
    \draw [line cap=round] (-3/4,0) -- (3/4,0) (0,-3/4) -- (0,3/4);
  }}
}
\begin{document}
\begin{tikzpicture}[minimum size=0.75cm]
\node [circle, draw, sin wave] at (-1, 0) {};
\node [circle, draw, plus]     at ( 0, 0) {};
\node [circle, draw, cross]    at ( 1, 0) {};
\end{tikzpicture}
\end{document}

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

답변2

노드 내부에 사인 곡선을 tikz 그림으로 넣을 수 있습니다.

\begin{tikzpicture}
\node[draw,circle,inner sep=-0.4pt] at (0,0)
{\tikz \draw[scale=0.15,domain=-3.141:3.141,smooth,variable=\t]
plot (\t,{sin(\t r)});};
\end{tikzpicture}

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

관련 정보