答案1
intersections
有了图书馆,一切就变得非常简单了。
\documentclass[border=5pt]{standalone}
\usepackage{tikz}
\usetikzlibrary{intersections}
\begin{document}
\begin{tikzpicture}
\path[draw, name path=L1,very thick]
(-6, 2.5)--(1, -0.5);
\path[draw, name path=L2,very thick]
(-6, 0)--(1, 0);
\path [draw, name path=LD1, dashed, thick]
(-3, 3)--(-5, -0.5);
\path [draw, name path=LD2, dashed, thick]
(-1, 3)--(-3, -0.5);
\path [name intersections={of=L2 and LD1, by={A}}];
\path [name intersections={of=L1 and LD2, by={B}}];
\draw [red,very thick,shorten >=-0.75cm, shorten <=-0.75cm] (A) -- (B);
\filldraw [red](A) circle (2pt)node[anchor=south east]{$A$};
\filldraw [red](B) circle (2pt)node[anchor=south]{$B$};
\end{tikzpicture}
\end{document}