% MWE如下: %----如何定义两条线段AD与BC延长线的交点 F ? % %----xelatex编译 ``` \documentclass{article} \usepackage{xeCJK}%使用xeCJK中文处理宏包 \usepackage{amsmath,amssymb,bm}%ams数学符号 \usepackage{tikz} \usetikzlibrary{arrows,intersections} \usetikzlibrary{positioning,backgrounds} \usetikzlibrary{fadings} \usetikzlibrary{patterns} \usetikzlibrary{calc} \usetikzlibrary{shadings} \pgfdeclarelayer{background} \pgfdeclarelayer{foreground} \pgfsetlayers{background,main,foreground} \usepackage{verbatim} \begin{document} \begin{tikzpicture}[scale=1.5,line width=0.75pt] %点A \coordinate (A) at (-1,0); \node[left] at (A) {$A$}; %点D \coordinate (D) at ([shift=(50:1.2cm)]A); \node[left] at (D) {$D$}; %点B \coordinate (B) at (1,0); \node[left] at (B) {$B$}; %点C \coordinate (C) at ([shift=(110:1.2cm)]B); \node[right] at (C) {$C$}; %失败尝试--定义直线AD与BC交点F \coordinate (F1) at ($(A)!2!0:(D)$); \coordinate (F2) at ($(B)!2!0:(C)$); \path[name path=x] (A)--(F1); \path[name path=y] (B)--(F2); \path[name intersections={of=x and y, name=i}] coordinate (F); \node[above] at (F) {$F$}; %失败尝试--定义直线AD与BC交点F %连线FAB \draw (F)--(A)--(B)--cycle; \end{tikzpicture} \end{document} ``` %======== 失败的运行效果图,如下: ![fail.png](/data/ueditor/php/upload/image/20190910/1568124721552773.png)

4 回答4

1
<p></p><p>又不是做数学题,把直线路径加长一点不就行了。</p><pre class="brush:plain;toolbar:false">\documentclass[tikz]{standalone} \usetikzlibrary{intersections} \usetikzlibrary{positioning,backgrounds} \begin{document} \begin{tikzpicture}[scale=1.5,line&nbsp;width=0.75pt] %点A &nbsp;&nbsp;\coordinate&nbsp;(A)&nbsp;at&nbsp;(-1,0); &nbsp;&nbsp;\node[left]&nbsp;at&nbsp;(A)&nbsp;{$A$}; %点D &nbsp;&nbsp;\coordinate&nbsp;(D)&nbsp;at&nbsp;([shift=(50:1.2cm)]A); &nbsp;&nbsp;\fill&nbsp;(D)&nbsp;circle&nbsp;(1pt)&nbsp;node[left]&nbsp;{$D$}; %点B &nbsp;&nbsp;\coordinate&nbsp;(B)&nbsp;at&nbsp;(1,0); &nbsp;&nbsp;\node[right]&nbsp;at&nbsp;(B)&nbsp;{$B$}; %点C &nbsp;&nbsp;\coordinate&nbsp;(C)&nbsp;at&nbsp;([shift=(110:1.2cm)]B); &nbsp;&nbsp;\fill&nbsp;(C)&nbsp;circle&nbsp;(1pt)&nbsp;node[right]&nbsp;{$C$}; &nbsp;&nbsp;\path&nbsp;[name&nbsp;path&nbsp;=AD]&nbsp;(A)--++(50:2.5); &nbsp;&nbsp;\path&nbsp;[name&nbsp;path&nbsp;=BC]&nbsp;(B)--++(110:2.5); &nbsp;&nbsp;\fill&nbsp;[name&nbsp;intersections={of=AD&nbsp;and&nbsp;BC,&nbsp;by={F}}]&nbsp;&nbsp;(F)&nbsp;circle(1pt)&nbsp;node&nbsp;[above]&nbsp;{$F$}; &nbsp;&nbsp;\draw[dashed]&nbsp;(F)--(D)(F)--(C); &nbsp;&nbsp;\draw&nbsp;(D)--(A)--(B)--(C); \end{tikzpicture} \end{document}</pre><p><img src="/data/ueditor/php/upload/image/20190910/1568125999626288.png" title="1568125999626288.png" alt="TIM4.png"/></p><p></p>
  • 非常感谢! – ChangChun_D 2019-09-16 16:22 回复
1
```tex %----当两条线段无交点,但所在直线有交点时,如何定义两条线段AD与BC延长线的交点 F ? % %----xelatex编译 \documentclass{article} \usepackage{xeCJK}%使用xeCJK中文处理宏包 \usepackage{amsmath,amssymb,bm}%ams数学符号 \usepackage{tikz} \usetikzlibrary{arrows,intersections} \usetikzlibrary{positioning,backgrounds} \usetikzlibrary{fadings} \usetikzlibrary{patterns} \usetikzlibrary{calc} \usetikzlibrary{shadings} \pgfdeclarelayer{background} \pgfdeclarelayer{foreground} \pgfsetlayers{background,main,foreground} \usepackage{verbatim} \begin{document} \begin{tikzpicture}[scale=1.5,line width=0.75pt] %点A \coordinate (A) at (-1,0); \node[left] at (A) {$A$}; %点D \coordinate (D) at ([shift=(50:1.2cm)]A); \node[left] at (D) {$D$}; %点B \coordinate (B) at (1,0); \node[left] at (B) {$B$}; %点C \coordinate (C) at ([shift=(110:1.2cm)]B); \node[right] at (C) {$C$}; %%失败尝试--定义直线AD与BC交点F % \coordinate (F1) at ($(A)!2!0:(D)$); % \coordinate (F2) at ($(B)!2!0:(C)$); % % \path[name path=x] (A)--(F1); % \path[name path=y] (B)--(F2); % \path[name intersections={of=x and y, name=i}] coordinate (F); % \node[above] at (F) {$F$}; %%失败尝试--定义直线AD与BC交点F %成功尝试--定义直线AD与BC交点F \path[name path=x] ($(A)!4!180:(D)$)--($(A)!4!0:(D)$); \path[name path=y] ($(B)!4!0:(C)$)--($(B)!4!180:(C)$); \path[name intersections={of=x and y,by=i}]; \coordinate (F) at (i); \node[above] at (F) {$F$}; %成功尝试--定义直线AD与BC交点F %连线FAB \draw (F)--(A)--(B)--cycle; \end{tikzpicture} \end{document} ```
  • 把失败的代码改一下,\path[name intersections={of=x and y, name=i}] coordinate (F)at(i-1); 再试试 – 咸菜的味道 2019-09-10 23:52 回复
1
tkz-euclide包,专门绘制平面几何图形的包(原包是法语包),我的博客已经给出了很多例子 https://yuxtech.github.io/2019/07/14/平面几何绘图示例/ ```tex \documentclass[tikz]{standalone} \usepackage{tkz-euclide}%%%加载tkz-euclide包 \begin{document} \begin{tikzpicture}[inner sep=1pt] \tkzDefPoints{0/0/A,3/0/B,1/1/D,2/1/C} %%等价于\coordinate(A)at(0,0);\coordinate(B)at(3,0);..... \tkzInterLL(A,D)(B,C)\tkzGetPoint{F} %%定义直线AD与BC的交点,得到交点F \draw(A)node[below]{$A$}--(F)node[above]{$F$}--(B)node[below]{$B$}--cycle; \draw(C)node[above right]{$C$}(D)node[above left]{$D$}; \tkzDrawPoints[size=2,fill=blue](A,B,C,D,F) \end{tikzpicture} ```
  • 这个好 – registor 2019-09-11 09:09 回复
0
%----当两条线段无交点,但所在直线有交点时,如何定义两条线段AD与BC延长线的交点 F ? % %----xelatex编译 \documentclass{article} \usepackage{xeCJK}%使用xeCJK中文处理宏包 \usepackage{amsmath,amssymb,bm}%ams数学符号 \usepackage{tikz} \usetikzlibrary{arrows,intersections} \usetikzlibrary{positioning,backgrounds} \usetikzlibrary{fadings} \usetikzlibrary{patterns} \usetikzlibrary{calc} \usetikzlibrary{shadings} \pgfdeclarelayer{background} \pgfdeclarelayer{foreground} \pgfsetlayers{background,main,foreground} \begin{document} \begin{tikzpicture}[scale=1.5,line width=0.75pt] %点A \coordinate (A) at (-1,0); \node[left] at (A) {$A$}; %点D \coordinate (D) at ([shift=(50:1.2cm)]A); \node[left] at (D) {$D$}; %点B \coordinate (B) at (1,0); \node[left] at (B) {$B$}; %点C \coordinate (C) at ([shift=(110:1.2cm)]B); \node[right] at (C) {$C$}; \coordinate[label=above:$G$] (G) at (intersection of A--D and B--C); \draw (G)--(A)--(B)--cycle; \end{tikzpicture} \end{document}
  • 使用(intersection of A—D and B—C); – 小白菜 2019-09-30 22:13 回复

你的回答

请登录后回答

你的回答将会帮助更多人,请务必认真回答问题。