
いくつかの二等分線を持つ円の交点にいくつかのノードを配置しようとしています。しかし、交点は予想どおりに動作しません。
テキスト間違っている円と灰色の線の交点に配置する必要がありますが、どうやらランダムな場所に配置されています。
さらに、コメント行のコメントを解除すると、両方の交差点がまったく同じ場所に配置されます。
(ただし、青いテキストはまさにその通りの場所です。)
何が間違っているのか誰か説明してもらえますか? どちらの場合でも、ノードが間違った場所に配置される理由がわかりません。
前もって感謝します!
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{calc,intersections}
\begin{figure}
\centering
\begin{tikzpicture}
\draw[thick,dashed, name path=circ] (2,2) circle (2cm);
\begin{scope}[shift={(2,2)}]
\filldraw (165:2) node[left=3.5pt] (c) {\large $c$} circle (3pt);
\filldraw (225:2) node[below=3.5pt] (b) {\large $b$} circle (3pt);
%\filldraw (135:2) node[above=3.5pt] (a) {\large $a$} circle (3pt);
\end{scope}
%\path[shorten >=-0.5cm,-, name path= path1] let \p1=($ (a) !.5! (b) $) in (2,2) -- ($(\p1)+(5,0)$);
%\draw[name intersections = {of =circ and path1}] (intersection-1) node[blue] (ab) {\Large right};
\path[shorten <= -0.5cm,-, name path=path3] let \p1=($ (b) !.5! (c) $) in (\p1) edge[gray] (2,2);
\draw[name intersections={of=circ and path3}] (intersection-1) node (bc) {wrong};
\end{tikzpicture}
\end{figure}
\end{document}
答え1
まず、MWE が実際にコンパイルされることを確認してください。ここには\begin{document}
tikz ライブラリcalc
がありません。
第二に、ここでの問題は、\path[shorten <= -0.5cm,-, name path=path3]
のshorten
部分がパスの長さ (計算に使用できる部分) に追加されず、表示されるバージョンにのみ追加されることです。したがって、交差を計算するために使用される線分は完全に円の内側にあり、見つからないというエラーが発生します。
これは効きそうだ
\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{intersections,calc}
\begin{document}
\begin{tikzpicture}
\draw[thick,dashed, name path=circ] (2,2) circle (2cm);
\begin{scope}[shift={(2,2)}]
\filldraw (165:2) node[left=3.5pt] (c) {\large $c$} circle (3pt);
\filldraw (225:2) node[below=3.5pt] (b) {\large $b$} circle (3pt);
% \filldraw (135:2) node[above=3.5pt] (a) {\large $a$} circle (3pt);
\end{scope}
% \path[shorten >=-0.5cm,-, name path= path1] let \p1=($ (a) !.5! (b) $) in (2,2) -- ($(\p1)+(5,0)$);
% \draw[name intersections = {of =circ and path1}] (intersection-1) node[blue] (ab) {\Large right};
% \path[shorten <= -0.5cm,-, name path=path3] let \p1=($
% (b) !.5! (c) $) in (\p1) edge[gray] (2,2);
\coordinate (d) at ($(b) !.5! (c) $);
\coordinate (o) at (2,2);
\draw[name path=path3] (o) -- ($(o)!1.5!(d)$);
\draw[name intersections={of=circ and path3,by=e}] (e) node (bc) {wrong};
\end{tikzpicture}
\end{document}
このタイプの質問にはスタンドアロン クラスの方が適しているため、これに切り替えました。また、figure
env はこの質問に関連しないため削除しました。