I know that I can draw a rectangle with tikz using \draw (0.0,0.0) rectangle (1.0,1.0);
. Is there a possibility to determine all 4 edge coordinates directly from the shape?
I do can save the lower left coordinate and the upper right by \draw (0.0,0.0) coordinate (lb) rectangle (1.0,1.0) coordinate (ru);
. But is there a way to get the upper left and bottom right corner directly from the shape?
I know I can calculate them. But are they directly accessible from the shape?
MWE
\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{calc}
\begin{document}
\begin{tikzpicture}
% the rectangle
\draw (0.0,0.0) coordinate (lb) rectangle (1.0,1.0) coordinate (ru);
% coordinates
\draw (lb) circle [radius=2pt];
\draw (ru) circle [radius=2pt];
% calculated coordinates
\draw[dashed] (lb |- ru) coordinate (lu) circle [radius=2pt];
\draw[dashed] (lb -| ru) coordinate (rb) circle [radius=2pt];
\end{tikzpicture}
\end{document}