
선과 원 사이의 교차점을 얻으려고 하는데 그 점에서 다른 점으로 그릴 때 교차점에서만 시작되지 않습니다.
내 코드는 다음과 같습니다.
\documentclass[margin=1mm]{standalone}
\usepackage{tikz}
\usetikzlibrary{intersections}
\begin{document}
\begin{tikzpicture}
\draw [name path = circle]
(0,0) circle (1);
\path [name path = en1] (-3,.4)--(3,.4);
\path [name path = en2] (-3,-.4)--(3,-.4);
\draw [name intersections={of=en1 and circle}]
(intersection-1) node (ne) {}
(intersection-2) node (no) {};
\draw [name intersections={of=en2 and circle}]
(intersection-1) node (so) {}
(intersection-2) node (se) {};
\draw
(0,0) -- (ne);
\end{tikzpicture}
\end{document}
답변1
설명에 명시된 대로 노드는 일부 공간을 차지합니다. [draw]
노드에 추가하면 볼 수 있습니다 . 교차점까지 선을 그리려면 선을 a로 지정하거나 coordinate
노드 중심에 선을 그립니다.
\documentclass[margin=1mm]{standalone}
\usepackage{tikz}
\usetikzlibrary{intersections}
\begin{document}
\begin{tikzpicture}
\draw [name path = circle]
(0,0) circle (1);
\path [name path = en1,draw,gray!40] (-3,.4)--(3,.4);
\path [name path = en2,draw,gray!40] (-3,-.4)--(3,-.4);
\draw [name intersections={of=en1 and circle}]
(intersection-1) node[draw] (ne) {}
(intersection-2) node (no) {};
\draw [name intersections={of=en2 and circle}]
(intersection-1) coordinate (so)
(intersection-2) coordinate (se);
\draw (0,0) -- (ne);
\draw (0,0) -- (no.center);
\draw (0,0) -- (se);
\end{tikzpicture}
\end{document}