答え1
関連する行は
\path [name intersections={of=D and E, by={[label=above:$C$]C, [label=below:$C’$]C’}}];
このよりシンプルなバージョンと比較してください:
\path [name intersections={of=D and E, by={C, C’}}];
ここで交差点が計算され、CとC'と名付けられます("名前の交差点ポイントDとEの による名CそしてC'()。
これは、
\coordinate (C) at ...;
\coordinate (C') at ...;
いくつかの計算された座標について。
オプションのスタイル[label=above:$C$]C
を追加すると、
\coordinate[label=above:$C$] (C) at ...;
交差点を直接スタイル設定することができます。これは、より長くなりますが、次のように書くこともできます。
\path [name intersections={of=D and E, by={C, C’}}];
\node[above] at (C) {$C$};
\node[below] at (C') {$C'$};
答え2
完全を期すために、交点にC-1
などという名前を付けることもできます。 交点を直線に沿って並べ替えたい場合は、次のようname=C
にするとよいかもしれません。直線を曲線のように描いてみなければならない。
\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{intersections}
\begin{document}
\begin{tikzpicture}
\draw[name path=grid] [xstep=3,ystep=2] (9,8) grid (0,0);
\draw[->, name path=line] (2,1) to[bend left=0] (7,7);
\draw[name intersections={of=grid and line, sort by=line, name=C, total=\t}]
\foreach \s in {1,...,\t}{(C-\s) node {\s}};
\end{tikzpicture}
\end{document}
答え3
デフォルトでは、交差点には 、 などの名前が付けられ(intersection-1)
ます(intersection-2)
。
最初に記述すると、 2 つの交差点は およびとby={a,b}
呼ばれます。(a)
(b)
142 ページの例を少し変更して見てみましょう。2 つの曲線の 9 つの交点が表示されています。交点の総数は で与えられますtotal
。
と記述するとby={a,b}
、最初の 2 つの交差点に 2 つの名前が付けられます。
(a)
または(intersection-1)
(b)
または(intersection-2)
(a)
は のエイリアスです(intersection-1)
が、その他はエイリアスを持たず、アクセス可能なままです。
\documentclass[border=5mm,tikz]{standalone}
\usetikzlibrary{intersections}
\begin{document}
\begin{tikzpicture}
\clip (-2,-2) rectangle (2,2);
\draw [name path=curve 1] (-2,-1) .. controls (8,-1) and (-8,1) .. (2,1);
\draw [name path=curve 2] (-1,-2) .. controls (-1,8) and (1,-8) .. (1,2);
\fill [name intersections={of=curve 1 and curve 2, by={a,b}, total=\t}]
[red, opacity=0.5, every node/.style={above left, black, opacity=1}]
\foreach \s in {1,...,\t}{(intersection-\s) circle (2pt) node {\footnotesize\s}};
\draw[fill=blue!50,opacity=.5] (a) circle (4pt);
\end{tikzpicture}
\end{document}