圆与线的交点“路径”

圆与线的交点“路径”
\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{intersections}
\begin{document}
\begin{tikzpicture}[
    plotmark/.style = {%
    solid, fill = red, circle, inner sep = 0pt, minimum size = 6pt
  }
]
    \coordinate (A) at (0,0);
    \coordinate (B) at (1,1);
    \coordinate (C) at (3,1);
    \coordinate (D) at (4,0);

    \draw[->] (A)--(B);
    \draw[->] (D)--(C);
    \draw[dashed] (A) circle [radius=2];

    \coordinate (I) at (intersection cs:first line={(A)--(B)}, second line={(C)--(D)});

    \node[plotmark, label={below:$A$}] at (A) {};
    \node[plotmark, label={below:$D$}] at (D) {};
    \node[plotmark, label={above:$I$}] at (I) {};
\end{tikzpicture}
\end{document}

上述代码中,虽然线段(A)--(B)(D)--(C)不相交,但\coordinate (I) at (intersection cs:first line={(A)--(B)}, second line={(C)--(D)});计算了交点,并输出:

在此处输入图片描述

有没有办法用intersection cs语法来定位路径AB与圆的交点?

以下语法要求线段与圆实际相交:

\path[name path=Circle] (A) circle [radius=2];
\path[name path=AB] (A)--(B);
\path [name intersections={of=Circle and AB}];
\coordinate (I) at (intersection-1);

答案1

这个答案有两种风格intersection 1 of lineintersection 2 of line,可以像这样使用:

\coordinate[intersection 1 of line={from A to B with circle around A with
    radius 2cm}] (aux1);

正如语法所示,这将找到穿过 的线AB半径2cm为的圆的一个交点A。当然,圆不必围绕线穿过的点,如下所示。此更新版本使用xfp来避免“尺寸过大”错误。(我希望我早点尝试过。;-)

\documentclass{standalone}
\usepackage{xfp}
\usepackage{tikz}
% smuggling from https://tex.stackexchange.com/a/470979/121799
\newcounter{smuggle}
\DeclareRobustCommand\smuggleone[1]{%
  \stepcounter{smuggle}%
  \expandafter\global\expandafter\let\csname smuggle@\arabic{smuggle}\endcsname#1%
  \aftergroup\let\aftergroup#1\expandafter\aftergroup\csname smuggle@\arabic{smuggle}\endcsname
}
\DeclareRobustCommand\smuggle[2][1]{%
  \smuggleone{#2}%
  \ifnum#1>1
    \aftergroup\smuggle\aftergroup[\expandafter\aftergroup\the\numexpr#1-1\aftergroup]\aftergroup#2%
  \fi
}

\usetikzlibrary{intersections,calc}
\begin{document}
\tikzset{intersection warning/.code={\pgfmathtruncatemacro{\mysign}{sign(#1)+1}
\ifcase\mysign
\typeout{The\space line\space and\space circle\space do\space not\space
intersect.\space The\space intersections\space returned\space are\space fake.}
\or
\typeout{The\space line\space and\space circle\space intersect\space
only\space once.}
\or
\fi},
fpeval/.code n args={2}{\edef#1{\fpeval{#2}}%\typeout{#1}%
\smuggle[2]{#1}},
intersection 1 of line/.style args={from #1 to #2 with circle around #3 with radius #4}{%
insert path={let \p1=(#1),\p2=(#2),\p3=(#3)
in [fpeval={\mydisc}{{-((\y1/10)*(\x2/10) - (\x1/10)*(\y2/10) - (\y1/10)*(\x3/10) + (\y2/10)*(\x3/10) + (\x1/10)*(\y3/10) - (\x2/10)*(\y3/10))^2 + 
(((\x1/10) - (\x2/10))^2 + ((\y1/10) - (\y2/10))^2)*(#4/10)^2}},
fpeval={\myfactor}{((\x1/10)^2 + (\y1/10)^2 + (\x2/10)*(\x3/10) - (\x1/10)*((\x2/10) + (\x3/10)) + (\y2/10)*(\y3/10) - 
     (\y1/10)*((\y2/10) + (\y3/10)) - 
     sqrt(abs(\mydisc)))/
    (((\x1/10) - (\x2/10))^2 + ((\y1/10) - (\y2/10))^2)},
intersection warning=\mydisc]($(#1)+\myfactor*($(#2)-(#1)$)$)}  },
intersection 2 of line/.style args={from #1 to #2 with circle around #3 with radius #4}{%
insert path={let \p1=(#1),\p2=(#2),\p3=(#3)
in [fpeval={\mydisc}{-((\y1/10)*(\x2/10) - (\x1/10)*(\y2/10) - (\y1/10)*(\x3/10) + (\y2/10)*(\x3/10) + (\x1/10)*(\y3/10) - (\x2/10)*(\y3/10))^2 + 
(((\x1/10) - (\x2/10))^2 + ((\y1/10) - (\y2/10))^2)*(#4/10)^2},
fpeval={\myfactor}{((\x1/10)^2 + (\y1/10)^2 + (\x2/10)*(\x3/10) - (\x1/10)*((\x2/10) + (\x3/10)) + (\y2/10)*(\y3/10) - 
(\y1/10)*((\y2/10) + (\y3/10)) +  sqrt(abs(\mydisc)))/
(((\x1/10) - (\x2/10))^2 + ((\y1/10) - (\y2/10))^2)}]
[intersection warning=\mydisc] ($(#1)+\myfactor*($(#2)-(#1)$)$)}  }
}

\begin{tikzpicture}[
    plotmark/.style = {%
    solid, fill = red, circle, inner sep = 0pt, minimum size = 6pt
  }
]
    \coordinate (A) at (0,0);
    \coordinate (B) at (1,1);
    \coordinate (C) at (3,1);
    \coordinate (D) at (4,0);
    \coordinate (E) at (1,0);
    \coordinate (F) at (2,-1);
    \coordinate (G) at (2,1);
    \coordinate (H) at (3,1);

    \draw[->] (A)--(B);
    \draw[->] (D)--(C);
    \draw[dashed] (A) circle [radius=2];

    \coordinate (I) at (intersection cs:first line={(A)--(B)}, second line={(C)--(D)});

    \node[plotmark, label={below:$A$}] at (A) {};
    \node[plotmark, label={below:$D$}] at (D) {};
    \node[plotmark, label={below:$E$}] at (E) {};
    \node[plotmark, label={above:$I$}] at (I) {};
    \coordinate[intersection 1 of line={from A to B with circle around A with
    radius 2cm}] (aux1);
    \typeout{aux2}
    \coordinate[intersection 2 of line={from A to B with circle around A with
    radius 2cm}] (aux2);
    \node[plotmark, label={below:$I_1$}] at (aux1) {};
    \node[plotmark, label={below:$I_2$}] at (aux2) {};
    \coordinate[intersection 1 of line={from E to B with circle around A with
    radius 2cm}] (aux3);
    \coordinate[intersection 2 of line={from E to B with circle around A with
    radius 2cm}] (aux4);
    \node[plotmark, label={below:$I_1'$}] at (aux3) {};
    \node[plotmark, label={below:$I_2'$}] at (aux4) {};
    \coordinate[intersection 1 of line={from F to G with circle around A with
    radius 2cm}] (aux5);
    \coordinate[intersection 1 of line={from F to H with circle around A with
    radius 2cm}] (aux6);
\end{tikzpicture}
\end{document}

在此处输入图片描述

如果没有相交,则会发出警告,如果线和圆仅相交一次,则会通知用户。分析计算的优点是确定相交点不会改变边界框。

附录:没有经过很好的测试,因为我觉得你应该写一个新问题。

\documentclass{article}
\usepackage{xfp}
% smuggling from https://tex.stackexchange.com/a/470979/121799
\newcounter{smuggle}
\DeclareRobustCommand\smuggleone[1]{%
  \stepcounter{smuggle}%
  \expandafter\global\expandafter\let\csname smuggle@\arabic{smuggle}\endcsname#1%
  \aftergroup\let\aftergroup#1\expandafter\aftergroup\csname smuggle@\arabic{smuggle}\endcsname
}
\DeclareRobustCommand\smuggle[2][1]{%
  \smuggleone{#2}%
  \ifnum#1>1
    \aftergroup\smuggle\aftergroup[\expandafter\aftergroup\the\numexpr#1-1\aftergroup]\aftergroup#2%
  \fi
}
\usepackage{tikz}
\usetikzlibrary{intersections,calc,through}
\tikzset{intersection warning/.code={\pgfmathtruncatemacro{\mysign}{sign(#1)+1}
\ifcase\mysign
\typeout{The\space line\space and\space circle\space do\space not\space
intersect.\space The\space intersections\space returned\space are\space fake.}
\or
\typeout{The\space line\space and\space circle\space intersect\space
only\space once.}
\or
\fi},
fpeval/.code n args={2}{\edef#1{\fpeval{#2}}%\typeout{#1}%
\smuggle[2]{#1}},
intersection 1 of line/.style args={from #1 to #2 with circle around #3 with radius #4}{%
insert path={let \p1=(#1),\p2=(#2),\p3=(#3)
in [fpeval={\mydisc}{-((\y1/10)*(\x2/10) - (\x1/10)*(\y2/10) - (\y1/10)*(\x3/10) + (\y2/10)*(\x3/10) + (\x1/10)*(\y3/10) - (\x2/10)*(\y3/10))^2 + 
       (((\x1/10) - (\x2/10))^2 + ((\y1/10) - (\y2/10))^2)*(#4/10)^2},
fpeval={\myfactor}{((\x1/10)^2 + (\y1/10)^2 + (\x2/10)*(\x3/10) - (\x1/10)*((\x2/10) + (\x3/10)) + (\y2/10)*(\y3/10) - 
     (\y1/10)*((\y2/10) + (\y3/10)) - 
     sqrt(abs(\mydisc)))/
    (((\x1/10) - (\x2/10))^2 + ((\y1/10) - (\y2/10))^2)}]
[intersection warning=\mydisc] ($(#1)+\myfactor*($(#2)-(#1)$)$)}  },
intersection 2 of line/.style args={from #1 to #2 with circle around #3 with radius #4}{%
insert path={let \p1=(#1),\p2=(#2),\p3=(#3)
in [fpeval={\mydisc}{-((\y1/10)*(\x2/10) - (\x1/10)*(\y2/10) - (\y1/10)*(\x3/10) + (\y2/10)*(\x3/10) + (\x1/10)*(\y3/10) - (\x2/10)*(\y3/10))^2 + 
       (((\x1/10) - (\x2/10))^2 + ((\y1/10) - (\y2/10))^2)*(#4/10)^2},
fpeval={\myfactor}{((\x1/10)^2 + (\y1/10)^2 + (\x2/10)*(\x3/10) - (\x1/10)*((\x2/10) + (\x3/10)) + (\y2/10)*(\y3/10) - 
     (\y1/10)*((\y2/10) + (\y3/10)) + 
     sqrt(abs(\mydisc)))/
    (((\x1/10) - (\x2/10))^2 + ((\y1/10) - (\y2/10))^2)}]
 [intersection warning=\mydisc] ($(#1)+\myfactor*($(#2)-(#1)$)$)}  },
circle through 3 points/.style n args={3}{%
insert path={let    \p1=($(#1)!0.5!(#2)$),
                    \p2=($(#1)!0.5!(#3)$),
                    \p3=($(#1)!0.5!(#2)!1!-90:(#2)$),
                    \p4=($(#1)!0.5!(#3)!1!90:(#3)$),
                    \p5=(intersection of \p1--\p3 and \p2--\p4)
                    in },
at={(\p5)},
circle through= {(#1)}
},
circle radius/.style args={#1 of circle at #2 through #3}{
insert path={let \p1=($(#2)-(#3)$),\n1={veclen(\x1,\y1)} 
in \pgfextra{\xdef#1{\n1}}}}
}

\begin{document}
\section*{Intersection of circle with line}

\begin{tikzpicture}
    \coordinate (A) at (0,0);
    \coordinate (B) at (1,1);
    \coordinate (C) at (3,1);
    \coordinate (D) at (4,0);
    \coordinate (E) at (1,0);
    \coordinate (F) at (2,-1);
    \coordinate (G) at (2,1);
    \draw (A) circle[radius=2cm];
    \foreach \X in {A,B,...,G}
    {\fill[blue] (\X) circle (2pt) node[above]{\X};}
%
    \coordinate[intersection 1 of line={from A to B with circle around A with
    radius 2cm}] (aux1);
    \coordinate[intersection 2 of line={from A to B with circle around A with
    radius 2cm}] (aux2);
    \coordinate[intersection 1 of line={from E to B with circle around A with
    radius 2cm}] (aux3);
    \coordinate[intersection 2 of line={from E to B with circle around A with
    radius 2cm}] (aux4);
    \coordinate[intersection 1 of line={from F to G with circle around A with
    radius 2cm}] (aux5);
    \foreach \X in {1,...,5}
    {\fill[red] (aux\X) circle (2pt) node[below]{\X};}
\end{tikzpicture}

\section*{Define the circle by center and point on it}

\begin{tikzpicture}
    \coordinate (A) at (0,0);
    \coordinate (B) at (1,1);
    \coordinate (C) at (3,1);
    \coordinate (D) at (4,0);
    \coordinate (E) at (1,0);
    \coordinate (F) at (2,-1);
    \coordinate (G) at (2,1);
    \path[circle radius={\myradius} of circle at A through G];
    \draw (A) circle[radius=\myradius];
    \foreach \X in {A,B,...,G}
    {\fill[blue] (\X) circle (2pt) node[above]{\X};}
%
    \coordinate[intersection 1 of line={from A to B with circle around A with
    radius \myradius}] (aux1);
    \coordinate[intersection 2 of line={from A to B with circle around A with
    radius \myradius}] (aux2);
    \coordinate[intersection 1 of line={from E to B with circle around A with
    radius \myradius}] (aux3);
    \coordinate[intersection 2 of line={from E to B with circle around A with
    radius \myradius}] (aux4);
    \coordinate[intersection 1 of line={from F to G with circle around A with
    radius \myradius}] (aux5);
    \foreach \X in {1,...,5}
    {\fill[red] (aux\X) circle (2pt) node[below]{\X};}
\end{tikzpicture}

\section*{Define the circle by 3 points}

\begin{tikzpicture}
    \coordinate (A) at (0,0);
    \coordinate (B) at (1,1);
    \coordinate (C) at (3,1);
    \coordinate (D) at (4,0);
    \coordinate (E) at (1,0);
    \coordinate (F) at (2,-1);
    \coordinate (G) at (2,1);
    \node[circle through 3 points={A}{F}{D},draw] (CN){};
    \path[circle radius={\myradius} of circle at CN.center through D];
    \draw[red,dashed] (CN.center) circle[radius=\myradius];
    \foreach \X in {A,B,...,G}
    {\fill[blue] (\X) circle (2pt) node[above]{\X};}
%
    \coordinate[intersection 1 of line={from E to C with circle around CN.center with
    radius \myradius}] (aux1);
    \foreach \X in {1}
    {\fill[red] (aux\X) circle (2pt) node[below]{\X};}
\end{tikzpicture}

\end{document}

在此处输入图片描述

附录二:出现错误时该怎么办dimension too largedimension too large任何坐标计算都可能出现臭名昭著的错误,因此它们也可能出现在这里。部分避免这些错误的一种方法是使用库。(但请注意,如果您使用库,fpu则可能必须(本地)关闭。)仅此一项就可以fpumath不是(必然)解决这个问题,但在以某种方式重写计算之后,auxmax可以识别出特征尺度,并且所有维度除以它似乎有效。

\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{intersections,calc}
\usetikzlibrary{fpu}
\begin{document}
\tikzset{declare
function={auxmax(\x,\y,\u,\v,\r,\s,\z)=sqrt(\x^2+\y^2+\u^2+\v^2+\r^2+\s^2+\z^2);
auxone(\x,\y,\u,\v,\r,\s,\z)=
-((\y/auxmax(\x,\y,\u,\v,\r,\s,\z))*(\u/auxmax(\x,\y,\u,\v,\r,\s,\z)) - (\x/auxmax(\x,\y,\u,\v,\r,\s,\z))*(\v/auxmax(\x,\y,\u,\v,\r,\s,\z)) - (\y/auxmax(\x,\y,\u,\v,\r,\s,\z))*(\r/auxmax(\x,\y,\u,\v,\r,\s,\z)) + (\v/auxmax(\x,\y,\u,\v,\r,\s,\z))*(\r/auxmax(\x,\y,\u,\v,\r,\s,\z)) + (\x/auxmax(\x,\y,\u,\v,\r,\s,\z))*(\s/auxmax(\x,\y,\u,\v,\r,\s,\z)) - (\u/auxmax(\x,\y,\u,\v,\r,\s,\z))*(\s/auxmax(\x,\y,\u,\v,\r,\s,\z)))^2 + 
       (((\x/auxmax(\x,\y,\u,\v,\r,\s,\z)) - (\u/auxmax(\x,\y,\u,\v,\r,\s,\z)))^2 + ((\y/auxmax(\x,\y,\u,\v,\r,\s,\z)) - (\v/auxmax(\x,\y,\u,\v,\r,\s,\z)))^2)*(\z/auxmax(\x,\y,\u,\v,\r,\s,\z))^2;
auxtwo(\x,\y,\u,\v,\r,\s,\z)=
((\x/auxmax(\x,\y,\u,\v,\r,\s,\z))^2 + (\y/auxmax(\x,\y,\u,\v,\r,\s,\z))^2 + (\u/auxmax(\x,\y,\u,\v,\r,\s,\z))*(\r/auxmax(\x,\y,\u,\v,\r,\s,\z)) - (\x/auxmax(\x,\y,\u,\v,\r,\s,\z))*((\u/auxmax(\x,\y,\u,\v,\r,\s,\z)) + (\r/auxmax(\x,\y,\u,\v,\r,\s,\z))) + (\v/auxmax(\x,\y,\u,\v,\r,\s,\z))*(\s/auxmax(\x,\y,\u,\v,\r,\s,\z)) - 
     (\y/auxmax(\x,\y,\u,\v,\r,\s,\z))*((\v/auxmax(\x,\y,\u,\v,\r,\s,\z)) + (\s/auxmax(\x,\y,\u,\v,\r,\s,\z))) - 
     sqrt(abs(\n1)))/
    (((\x/auxmax(\x,\y,\u,\v,\r,\s,\z)) - (\u/auxmax(\x,\y,\u,\v,\r,\s,\z)))^2 + ((\y/auxmax(\x,\y,\u,\v,\r,\s,\z)) - (\v/auxmax(\x,\y,\u,\v,\r,\s,\z)))^2);       
auxthree(\x,\y,\u,\v,\r,\s,\z)=-((\y/auxmax(\x,\y,\u,\v,\r,\s,\z))*(\u/auxmax(\x,\y,\u,\v,\r,\s,\z)) - (\x/auxmax(\x,\y,\u,\v,\r,\s,\z))*(\v/auxmax(\x,\y,\u,\v,\r,\s,\z)) - (\y/auxmax(\x,\y,\u,\v,\r,\s,\z))*(\r/auxmax(\x,\y,\u,\v,\r,\s,\z)) + (\v/auxmax(\x,\y,\u,\v,\r,\s,\z))*(\r/auxmax(\x,\y,\u,\v,\r,\s,\z)) + (\x/auxmax(\x,\y,\u,\v,\r,\s,\z))*(\s/auxmax(\x,\y,\u,\v,\r,\s,\z)) - (\u/auxmax(\x,\y,\u,\v,\r,\s,\z))*(\s/auxmax(\x,\y,\u,\v,\r,\s,\z)))^2 + 
       (((\x/auxmax(\x,\y,\u,\v,\r,\s,\z)) - (\u/auxmax(\x,\y,\u,\v,\r,\s,\z)))^2 + ((\y/auxmax(\x,\y,\u,\v,\r,\s,\z)) - (\v/auxmax(\x,\y,\u,\v,\r,\s,\z)))^2)*(\z/auxmax(\x,\y,\u,\v,\r,\s,\z))^2;
auxfour(\x,\y,\u,\v,\r,\s,\z)=((\x/auxmax(\x,\y,\u,\v,\r,\s,\z))^2 + (\y/auxmax(\x,\y,\u,\v,\r,\s,\z))^2 + (\u/auxmax(\x,\y,\u,\v,\r,\s,\z))*(\r/auxmax(\x,\y,\u,\v,\r,\s,\z)) - (\x/auxmax(\x,\y,\u,\v,\r,\s,\z))*((\u/auxmax(\x,\y,\u,\v,\r,\s,\z)) + (\r/auxmax(\x,\y,\u,\v,\r,\s,\z))) + (\v/auxmax(\x,\y,\u,\v,\r,\s,\z))*(\s/auxmax(\x,\y,\u,\v,\r,\s,\z)) - 
     (\y/auxmax(\x,\y,\u,\v,\r,\s,\z))*((\v/auxmax(\x,\y,\u,\v,\r,\s,\z)) + (\s/auxmax(\x,\y,\u,\v,\r,\s,\z))) + 
     sqrt(abs(\n1))/
    (((\x/auxmax(\x,\y,\u,\v,\r,\s,\z)) - (\u/auxmax(\x,\y,\u,\v,\r,\s,\z)))^2 + ((\y/auxmax(\x,\y,\u,\v,\r,\s,\z)) - (\v/auxmax(\x,\y,\u,\v,\r,\s,\z)))^2);
}}
\tikzset{intersection warning/.code={\pgfmathtruncatemacro{\mysign}{sign(#1)+1}
\ifcase\mysign
\typeout{The\space line\space and\space circle\space do\space not\space
intersect.\space The\space intersections\space returned\space are\space fake.}
\or
\typeout{The\space line\space and\space circle\space intersect\space
only\space once.}
\or
\fi},
intersection 1 of line/.style args={from #1 to #2 with circle around #3 with radius #4}{%
insert path={let \p1=(#1),\p2=(#2),\p3=(#3),
\n1={auxone(\x1,\y1,\x2,\y2,\x3,\y3,#4)},
\n2={auxtwo(\x1,\y1,\x2,\y2,\x3,\y3,#4)}
in [intersection warning=\n1]($(#1)+\n2*($(#2)-(#1)$)$)}  },
intersection 2 of line/.style args={from #1 to #2 with circle around #3 with radius #4}{%
insert path={let \p1=(#1),\p2=(#2),\p3=(#3),
\n1={auxthree(\x1,\y1,\x2,\y2,\x3,\y3,#4)},
\n2={auxfour(\x1,\y1,\x2,\y2,\x3,\y3,#4)}
in [intersection warning=\n1] ($(#1)+\n2*($(#2)-(#1)$)$)}  }
}

\begin{tikzpicture}[/pgf/fpu=true,/pgf/fpu/output format=fixed]
    \pgfmathsetmacro{\myConstant}{5*sqrt(2)} 
    \coordinate (A) at (0,0); 
    \coordinate (B) at (0, \myConstant); 
    \coordinate (C) at (10, \myConstant); 
    \coordinate (D) at (10,0); 
    \coordinate (midBC) at (5, \myConstant); 
    \coordinate (midAD) at (5, 0); 
    \coordinate[intersection 1 of line={from midBC to A with circle around midAD with radius 5cm}] (aux1);
    \foreach \X in {A,B,C,D,midBC,midAD,aux1}   
    {\fill (\X) circle(1pt) node[above]{\X};}
\end{tikzpicture}
\end{document}

在此处输入图片描述

答案2

还有\tkzInterLC 来自tkz-euclide即使线与圆不相交,也可以计算它们之间的交点:

\documentclass{standalone}
\usepackage{tikz,tkz-euclide}
\usetikzlibrary{intersections}
\begin{document}
\begin{tikzpicture}[
    plotmark/.style = {%
    solid, fill = red, circle, inner sep = 0pt, minimum size = 6pt
  }
]
    \coordinate (A) at (0,0);
    \coordinate (B) at (1,1);
    \coordinate (C) at (3,1);
    \coordinate (D) at (4,0);

    \draw[->] (A)--(B);
    \draw[->] (D)--(C);
    \draw[dashed] (A) circle [radius=2];

    \coordinate (I) at (intersection cs:first line={(A)--(B)}, second line={(C)--(D)});

    \node[plotmark, label={below:$A$}] at (A) {};
    \node[plotmark, label={below:$B$}] at (B) {};
    \node[plotmark, label={below:$D$}] at (D) {};
    \node[plotmark, label={above:$I$}] at (I) {};

    \tkzInterLC[R](A,B)(A,2cm) % line (A,B) and circle(A,2cm) 
     \tkzGetPoints{E}{F} % intersection points
    \node[plotmark, label={below:$E$}] at (E) {};
    \node[plotmark, label={below:$F$}] at (F) {};
\end{tikzpicture}
\end{document}

在此处输入图片描述

答案3

结合intersection cs:first line={...}, second line={...}name intersections={of=<name path 1> and <name path 2>,...

\documentclass[tikz, margin=3mm]{standalone}
\usetikzlibrary{intersections}

\begin{document}
\begin{tikzpicture}[
    plotmark/.style = {%
    solid, fill = red, circle, inner sep = 0pt, minimum size = 6pt
  }
]
\coordinate (A) at (0,0);
\coordinate (B) at (1,1);
\coordinate (C) at (3,1);
\coordinate (D) at (4,0);

\draw[->] (A)--(B);
\draw[->] (D)--(C);
\draw[dashed, name path=Circle] (A) circle [radius=2];  % <---

\coordinate (I) at (intersection cs:first line={(A)--(B)}, second line={(C)--(D)});
\path[name path=AI] (A) -- (I);                         % <---
\path[name intersections={of=AI and Circle,by={E}}]     % <---
                node[plotmark, label=$E$] at (E) {};    % <--- 

\node[plotmark, label={below:$A$}] at (A) {};
\node[plotmark, label={below:$D$}] at (D) {};
\node[plotmark, label={above:$I$}] at (I) {};
\end{tikzpicture}
\end{document}

在此处输入图片描述

相关内容