영역 외부를 음영 처리하는 방법

영역 외부를 음영 처리하는 방법

반원에서 멀어질수록 색상이 희미해지도록 x축에 수직인 반원의 외부를 어떻게 음영 처리합니까? 도와 주셔서 감사합니다!

\begin{tikzpicture}
\draw[blue] (-1,0) .. controls (-1,0.555) and (-0.555,1) .. (0,1)
.. controls (0.555,1) and (1,0.555) .. (1,0);
\draw (-2,0) -- (2,0);
\end{tikzpicture}

답변1

이것은 약간 어리석은 것일 수도 있지만, 당신이 요구하는 것을 할 것입니다.

출력

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

코드

\documentclass[tikz,border=5pt]{standalone}
\begin{document}
\begin{tikzpicture}
  \def\ymax{3}
  \def\xmax{3}
  \begin{scope}
    \clip (-\xmax, 0) rectangle (\xmax, \ymax) ;
    \shade[inner color=red,outer color=white] (0,0) circle (3);
    \draw[blue, fill=white] (0,0) circle (1) ;
  \end{scope}
  \draw [thick, ->] (-\xmax,0) -- (\xmax,0) ;
\end{tikzpicture}
\end{document}

관련 정보