Consider this a side-answer to the original question, since the solution is provided using pstricks
.
pstricks-add
provides this point of intersection by means of the macro
\psIntersectionPoint(<P0>)(<P1>)(<P2>)(<P3>){<node name>}
where P0
and P1
define one straight line (say 0-1
) and P2
and P3
define another straight line (say 2-3
). <node name>
is the name of the saved node at the intersection of 0-1
and 2-3
. The following example is taken directly from the pstricks-add
package documentation:
\documentclass{article}
\usepackage{pstricks-add}% http://ctan.org/pkg/pstricks-add}
\begin{document}
\psset{unit=0.5cm}
\begin{pspicture}(-5,-4)(5,5)
\psaxes[labelFontSize=\scriptstyle,
dx=2,Dx=2,dy=2,Dy=2]{->}(0,0)(-5,-4)(5,5)
\psline[linecolor=red,linewidth=2pt](-5,-1)(5,5)
\psline[linecolor=blue,linewidth=2pt](-5,3)(5,-4)
\qdisk(-5,-1){2pt}\uput[-90](-5,-1){A}
\qdisk(5,5){2pt}\uput[-90](5,5){B}
\qdisk(-5,3){2pt}\uput[-90](-5,3){C}
\qdisk(5,-4){2pt}\uput[-90](5,-4){D}
\psIntersectionPoint(-5,-1)(5,5)(-5,3)(5,-4){IP}
\qdisk(IP){3pt}\uput{0.3}[90](IP){IP}
\psline[linestyle=dashed](IP|0,0)(IP)(0,0|IP)
\end{pspicture}
\end{document}
