I have the display that I want ... but I do not know how the code gives it! The following display has a square sharing an edge with an equilateral triangle. I position point A with the command
\node (A-label) at ($(A)+(225:10pt)$) {$A$};.
I want the label D to be the same distance below the (invisible) line through points A and D and directly below the vertex to which D is a label. Using the Pythagorean Theorem, the distance needed is
10pt*sqrt(2)*(1/2) = 5pt*sqrt(2).
I use the code
\node (D-label) at ($(D)+(-90:5pt*sqrt(2))$) {$D$};
and get an error; I use the code
\node (D-label) at ($(D)+(-90:5pt*sqrt(2)$) {$D$};
and get the label positioned correctly. My concern is that I am missing a right parenthesis in the last command.
\documentclass{amsart}
\usepackage{tikz}
\usetikzlibrary{calc,angles,positioning,intersections}
\usepackage{pgfplots}
\pgfplotsset{compat=1.11}
\begin{document}
\begin{tikzpicture}
\coordinate (A) at (-1,-1);
\coordinate (B) at (-1,1);
\coordinate (C) at (1,1);
\coordinate (D) at (1,-1);
\draw (A) -- (B) -- (C) -- (D) -- cycle;
\path[name path=ray1] (C) -- ($(C) + (-30:3)$);
\path[name path=ray2] (D) -- ($(D) + (30:3)$);
\coordinate[name intersections={of=ray1 and ray2,by={P}}];
\node[label={right:$P$}] at (P) {};
%\draw (P) -- ($(D)!(P)!(C)$);
\draw (C) -- (P) -- (D);
\node[fill=white,circle,inner sep=0.5pt] (A-label) at ($(A)+(225:10pt)$) {$A$};
\node[fill=white,circle,inner sep=0.5pt] (B-label) at ($(B)+(135:10pt)$) {$B$};
\node[fill=white,circle,inner sep=0.5pt] (C-label) at ($(C)+(90:5pt*sqrt(2)$) {$C$};
\node[fill=white,circle,inner sep=0.5pt] (D-label) at ($(D)+(-90:5pt*sqrt(2)$) {$D$};
\node[fill=white,circle,inner sep=0.5pt] (P-label) at ($(P)+(0:10pt)$) {$P$};
\end{tikzpicture}
\end{document}
