TikZ 图上两个节点放置不正确

TikZ 图上两个节点放置不正确

我有一个三角形的代码。画了一条中线,并画了四个角的度量标记。我对图中的\theta和 的位置有疑问\psi。这些代码位于代码的最后八行中。从两个角的顶点画了一条虚线,以指示我想要的位置\theta和 的\psi放置位置。为什么它们不放在这些虚线上?

\documentclass{amsart}
\usepackage{amsmath}
\usepackage{amsfonts}

\usepackage{tikz}
\usetikzlibrary{calc}

\begin{document}

\begin{tikzpicture}

%Points A and B are drawn on the circle.
\path (-2,0) coordinate (A) (2,0) coordinate (B) (0,3.5) coordinate (C);
\node[anchor=north, inner sep=0] at ($(A)!0.15cm!-90:(B)$){$A$};
\node[anchor=north, inner sep=0] at ($(B)!0.15cm!90:(A)$){$B$};
\node[anchor=south, inner sep=0] at ($(C)!-0.15cm!(0,0)$){$C$};
\draw (A) -- (B) -- (C) -- cycle;

\coordinate (P) at (0,0);
\node[anchor=north, inner sep=0] at ($(P)!0.15cm!-90:(B)$){$P$};
\draw[dashed] (P) -- (C);


%The line segments from $P$ that are perpendicular to AB and to BC are drawn.
%The foot of the perpendicular on AC is called Q, and the foot of the
%perpendicular on BC is called R.

\coordinate (Q) at  ($(A)!(P)!(C)$);
\draw (P) -- (Q);
%A right-angle mark is drawn at Q.
\coordinate (U) at ($(Q)!3mm!-45:(C)$);
\draw[dash dot] (U) -- ($(Q)!(U)!(C)$);
\draw[dash dot] (U) -- ($(Q)!(U)!(P)$);

\coordinate (R) at  ($(B)!(P)!(C)$);
\draw (P) -- (R);
%A right-angle mark is drawn at R.
\coordinate (U) at ($(R)!3mm!45:(C)$);
\draw[dash dot] (U) -- ($(R)!(U)!(C)$);
\draw[dash dot] (U) -- ($(R)!(U)!(P)$);


%The mark for measure of $\angle{ACP}$ is drawn. It is marked with "|".
\draw[draw=blue] let \p1=($(C)-(A)$), \n1={atan(\y1/\x1)} in ($(C)!0.5cm!(A)$) arc ({\n1-180}:-90:0.5);
\draw[blue] let \p1=($(C)-(A)$), \n1={atan(\y1/\x1)} in ($(C) +({0.5*(\n1-180-90)}:{0.5cm-3pt})$) -- ($(C) +({0.5*(\n1-180-90)}:{0.5cm+3pt})$);

%The mark for measure of $\angle{BCP}$ is drawn. It is marked with "|".
\draw[draw=blue] let \p1=($(C)-(B)$), \n1={atan(\y1/\x1)} in ($(C)!0.5cm!(B)$) arc (\n1:-90:0.5);
\draw[blue] let \p1=($(C)-(B)$), \n1={atan(\y1/\x1)} in ($(C) +({0.5*(\n1-90)}:{0.5cm-3pt})$) -- ($(C) +({0.5*(\n1-90)}:{0.5cm+3pt})$);


%The mark for measure of $\angle{CAB}$ is drawn. It is labeled $\theta$.
\draw[draw=blue] let \p1=($(A)-(C)$), \n1={atan(\y1/\x1)} in ($(A)!0.3cm!(B)$) arc (0:\n1:0.3);
\draw[draw=blue] let \p1=($(A)-(C)$), \n1={atan(\y1/\x1)} in node[anchor={\n1-180}, inner sep=0, font=\footnotesize] at ($(A) + ({0.5*\n1}:0.35)$){$\theta$};
\draw[dashed] let \p1=($(A)-(C)$), \n1={atan(\y1/\x1)} in (A) -- ($(A) + ({0.5*\n1}:0.75)$);

%The mark for measure of $\angle{CBA}$ is drawn. It is labeled $\psi$.
\draw[draw=blue] let \p1=($(B)-(C)$), \n1={atan(\y1/\x1)} in ($(B)!0.3cm!(C)$) arc ({\n1+180}:180:0.3);
\draw[draw=blue] let \p1=($(B)-(C)$), \n1={atan(\y1/\x1)} in node[anchor=\n1, inner sep=0, font=\footnotesize] at ($(B) + ({0.5*\n1+180}:0.35)$){$\psi$};
\draw[dashed] let \p1=($(B)-(C)$), \n1={atan(\y1/\x1)} in (B) -- ($(B) + ({0.5*\n1+180}:0.75)$);
\end{tikzpicture}

\end{document}

相关内容