答案1
一个棘手的解决方案。将点放置在您想要的位置,并用负值在它们之间画线shorten
。这样,就不需要寻找交点了。
\documentclass[border=2cm,tikz]{standalone}
\usetikzlibrary{positioning, backgrounds}
\begin{document}
\begin{tikzpicture}[
point/.style={circle, fill=red, inner sep=0pt, minimum size=3mm},
line/.style 2 args={blue, thick, shorten <=-#2, shorten >=-#1},
line/.default={1cm}{1cm}]
\node[point] (a){};
\node[point, above right=3cm and 1cm of a] (b){};
\node[point, above left=2.5cm and 1cm of a] (c){};
\node[point, above left=4cm and 3mm of a] (d){};
\begin{scope}[on background layer]
\draw[line] (a)--(b);
\draw[line={3.5cm}{1cm}] (a)--(c);
\draw[line] (a)--(d);
\draw[line] (b)--(c);
\draw[line={2.5cm}{1cm}] (b)--(d);
\draw[line] (c)--(d);
\end{scope}
\end{tikzpicture}
\end{document}
答案2
\documentclass{article} % or another class
\usepackage{tkz-euclide} % no need to load TikZ
\begin{document}
\begin{tikzpicture}
\tkzDefPoint(0,0){I}
\tkzDefPoint(4,0.5){J}
\tkzDefShiftPoint[I](-60:5.5){I1}
\tkzDefShiftPoint[J](255:5.5){J1}
\tkzDrawLine[blue, ultra thick](I,I1)
\tkzDrawLine[blue, ultra thick](J,J1)
\tkzInterLL(I,I1)(J,J1)\tkzGetPoint{X}
\tkzDrawPoint[size=6,fill=red](X)
\end{tikzpicture}
\end{document}