
TikZの使い方について助けが必要ですnonzero rule
動作します。これは、いくつかの点から始まる光線の交差の数を数えると書かれています。fill
三角形と円の公式例三角形と円の交点が塗りつぶされていないため、理解できなくなりました。
これを理解するために、私はその例を調整し、2 つの円の 2 番目の例を追加しました。
\begin{document}
\begin{tikzpicture}
\filldraw[fill=yellow]
% Clockwise isoceles right-angled triangle
(0,0) -- (1,1) -- (2,0) --cycle
% Small circle centered on the leftmost vertex
(0,0) circle (.5);
\draw[->] (0,0) -- (.3,.3);
\draw[->] (1,1) -- (1.5,.5);
\draw[->] (2,0) -- (1,0);
\draw[->] (120:.5) arc (120:90:.5);
\draw[->] (300:.5) arc (300:270:.5);
\draw[->] (.2,.1) -- +(0,1) node[above] {crossings: $1+1 = 2$};
\begin{scope}[yshift=-3cm]
\filldraw[fill=yellow]
% Two circles
(0,0) circle (.5)
(.5,0) circle (.5);
\draw[->] (120:.5) arc (120:90:.5);
\draw[->] (300:.5) arc (300:270:.5);
\draw[->] (120:.5)+(.5,0) arc (120:90:.5);
\draw[->] (300:.5)+(.5,0) arc (300:270:.5);
\draw[->] (.2,.1) -- +(0,1) node[above] {crossings: $1+1 = 2$};
\end{scope}
\end{tikzpicture}
\end{document}
以下の内容を理解するのが困難です:
- 1 番目の例では、交差部分は塗りつぶされていません。
- 2番目の例では、交差部分が塗りつぶされています。
交差点の数が同じだからです。なぜそうなるのか説明していただけますか?
答え1
円の描画方向を反転して修正しました。[x radius=-\r, y radius=\r]
\documentclass[tikz, border=1cm]{standalone}
\begin{document}
\begin{tikzpicture}
\filldraw[fill=yellow]
(0,0) -- (1,1) -- (2,0) --cycle
(0,0) circle[x radius=-0.5, y radius=0.5];
\draw[->] (0,0) -- (.3,.3);
\draw[->] (1,1) -- (1.5,.5);
\draw[->] (2,0) -- (1,0);
\draw[->] (120:.5) arc (120:90:.5);
\draw[->] (300:.5) arc (300:270:.5);
\draw[->] (.2,.1) -- +(0,1) node[above] {crossings: $1+1 = 2$};
\begin{scope}[yshift=-3cm]
\filldraw[fill=yellow]
(0,0) circle[x radius=-0.5, y radius=0.5]
(.5,0) circle[x radius=-0.5, y radius=0.5];
\draw[->] (120:.5) arc (120:90:.5);
\draw[->] (300:.5) arc (300:270:.5);
\draw[->] (120:.5)+(.5,0) arc (120:90:.5);
\draw[->] (300:.5)+(.5,0) arc (300:270:.5);
\draw[->] (.2,.1) -- +(0,1) node[above] {crossings: $1+1 = 2$};
\end{scope}
\end{tikzpicture}
\end{document}