\tkzMarkRightAngle 有点问题

\tkzMarkRightAngle 有点问题

我有这个代码:

\documentclass{article}
\usepackage{pgfplots}
\pgfplotsset{compat=newest}
\usepackage{tikz} 
\usetikzlibrary{matrix,decorations.pathreplacing}
\usetikzlibrary{calc,angles,positioning,intersections,quotes,decorations.markings}
\usepackage{tkz-euclide}
\usetkzobj{all}

\begin{document}
\begin{tikzpicture}%[dot/.style={fill,circle,inner sep=1.5pt}]
\path
  (30:5) node [label=below right:$v_i\in M_2$,yshift={5pt}]{} coordinate (A)
  (30:7) coordinate (a)
  (-20:5) node [label=above right:$u_i\in M_1$,yshift={-10pt}]{} coordinate (B)
  (-20:7) coordinate (b)
  (0:0) node {} coordinate(P);

\path
  (0:0) node {}
coordinate(W)
  (90:4) node [label=left:$w_i$]{}
coordinate (Z)
  (90:6) coordinate (z);

\node (Q) at ($(P)!(A)!(B)$) {};
\node (R) at ($(P)!(B)!(A)$) {};

\draw[<->]  (P) -- (A);
\draw (P) -- (a);
\draw  (P) -- (b);
\draw[->] (P) -- (B);
\draw[->] (P) -- (Z);
\draw (P) -- (z);

\draw[purple!70!black,dashed] (A) -- (Q);
\draw[green!70!black] (B) -- (R);
\tkzMarkRightAngle(A,Q,P)
\tkzMarkRightAngle(B,R,P)

\tkzMarkAngle[size=0.75cm,color=cyan,label=$\theta$](B,P,A);
\end{tikzpicture} }
\end{document}

要得到:

在此处输入图片描述

如您所见,直角的正方形看起来不太好。我做错了什么吗?有什么选项或库是不需要的吗?

PD:我读过直角标记未正确显示但问题仍然存在%[dot/.style={fill,circle,inner sep=1.5pt}]

PD:我有其他包裹,但是与这张图无关。

PD:如果某些包裹丢失,很抱歉。

答案1

不要使用\nodes 来表示Qand R\coordinate而要使用 s ;a\node具有inner sepand ,outer sep这会导致问题。

在此处输入图片描述

代码:

\documentclass{article}
\usepackage{pgfplots}
\pgfplotsset{compat=newest}
\usepackage{tikz} 
\usetikzlibrary{matrix,decorations.pathreplacing}
\usetikzlibrary{calc,angles,positioning,intersections,quotes,decorations.markings}
\usepackage{tkz-euclide}
\usetkzobj{all}

\begin{document}
\begin{tikzpicture}%[dot/.style={fill,circle,inner sep=1.5pt}]
\path
  (30:5) node [label=below right:$v_i\in M_2$,yshift={5pt}]{} coordinate (A)
  (30:7) coordinate (a)
  (-20:5) node [label=above right:$u_i\in M_1$,yshift={-10pt}]{} coordinate (B)
  (-20:7) coordinate (b)
  (0:0) node {} coordinate(P);

\path
  (0:0) node {}
coordinate(W)
  (90:4) node [label=left:$w_i$]{}
coordinate (Z)
  (90:6) coordinate (z);

\coordinate (Q) at ($(P)!(A)!(B)$);
\coordinate (R) at ($(P)!(B)!(A)$);

\draw[<->]  (P) -- (A);
\draw (P) -- (a);
\draw  (P) -- (b);
\draw[->] (P) -- (B);
\draw[->] (P) -- (Z);
\draw (P) -- (z);

\draw[purple!70!black,dashed] (A) -- (Q);
\draw[green!70!black] (B) -- (R);
\tkzMarkRightAngle(P,Q,A)
\tkzMarkRightAngle(P,R,B)

\tkzMarkAngle[size=0.75cm,color=cyan,label=$\theta$](B,P,A);
\end{tikzpicture}
\end{document}

附注:由于你正在加载tkz-euclide并使用其中的一些功能,因此你可以使用软件包命令和功能来完成大多数直接使用 TikZ 的操作;例如,

\coordinate (Q) at ($(P)!(A)!(B)$);
\coordinate (R) at ($(P)!(B)!(A)$);

您可以使用

\tkzDefPointBy[projection=onto P--B](A)
\tkzGetPoint{Q}
\tkzDefPointBy[projection=onto P--A](B)
\tkzGetPoint{R}

相关内容