如何定义两条线段AD与BC延长线的交点 F ?

2019-09-10 22:12发布

% MWE如下: %----如何定义两条线段AD与BC延长线的交点 F ? % %----xelatex编译 ``` \documentclass{article} \usepackage{xeCJ...

% 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条回答
ChangChun_D
2019-09-10 22:26
```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} ```

一周热门 更多>