Monday, 12 August 2013

Given four nodes forming a quadrilateral, how do I find the node at the intersection of the diagonals

Given four nodes forming a quadrilateral, how do I find the node at the
intersection of the diagonals

I'm trying to find and name a node at the intersection of the diagonals of
a quadrilateral formed by four other nodes. However, I'm not drawing a
path. All I can seem to find in the tikz manual are examples involving
drawing paths. Is there a way to do this without drawing anything?
For example,
\documentclass{article}
\usepackage{tikz}
\pagestyle{empty}
\begin{document}
\begin{tikzpicture}
\node (A) at (0,0) {1};
\node (B) at (1,0) {2};
\node (C) at (5,3) {3};
\node (D) at (-2,7) {4};
\end{tikzpicture}
\end{document}
How do I find and label the node at the intersection of the diagonals AC
and BD?
Actually, most of the quadrilaterals I'm working with are rectangles with
sides parallel to the axes. So, I'd be interested in solution that might
only work for rectangles too.

No comments:

Post a Comment