為什麼 \tkzLabelAngle 不能將標籤放置在正確的角度?

為什麼 \tkzLabelAngle 不能將標籤放置在正確的角度?

在下圖中,我嘗試標記 angle (lA,A,oA),但無論我嘗試什麼,標籤最終都會處於 angle 中(rA,A,B)。這裡發生了什麼事?

\documentclass[border=10pt]{standalone}
\usepackage{tkz-euclide}
\usetikzlibrary{arrows.meta}
\usetkzobj{all}

\newlength\aehlength
\setlength\aehlength{1in}

\begin{document}

\begin{tikzpicture}[my dot/.style={fill,circle,inner sep=1.5pt},>={To[scale=2]}]
  \coordinate (A) at (0,0);
  \coordinate (B) at (55:\aehlength);
  \coordinate (lA) at ($(A)+(180:\aehlength)$);
  \coordinate (rA) at ($(A)+(0:\aehlength)$);
  \coordinate (lB) at ($(B)+(180:\aehlength)$);
  \coordinate (rB) at ($(B)+(0:\aehlength)$);
  \coordinate (oA) at ($(A)!-1cm!(B)$);
  \coordinate (oB) at ($(B)!-1cm!(A)$);

  \foreach \mynA/\mypA/\mynB/\mypB in {A/2cm/B/2cm,lA/1cm/rA/1cm,lB/1cm/rB/1cm}
  {
    \draw[arrows=<->] ($(\mynA)!-\mypA!(\mynB)$) -- ($(\mynB)!-\mypB!(\mynA)$);
  }

  \foreach \myn/\myp in {A/90,B/90,lA/90,rA/90,lB/90,rB/90,oA/90,oB/90 }
  {
      \node[my dot] at (\myn) {};
      \node at ($(\myn)+(\myp:8pt)$) {\myn};
  }

  \tkzLabelAngle[pos=0.45](oA,A,lA) {$x$}
  \tkzLabelAngle[pos=0.45](lA,A,oA) {$x$}
  \tkzLabelAngle[pos=0.75](oB,B,rB) {$60^\circ$}

\end{tikzpicture}
\end{document}

在此輸入影像描述

答案1

帶有純 tkz-euclide 新版本CTAN v 3.01

\documentclass[border=10pt]{standalone}
\usepackage{tkz-euclide}

\def\aehlength{3}
\begin{document}

\begin{tikzpicture}
  \tkzDefPoint(0,0){A}
  \tkzDefPoint(55:\aehlength){B}
  \tkzDefShiftPoint[A](180:\aehlength){lA}
  \tkzDefShiftPoint[A](0:\aehlength){rA}
  \tkzDefShiftPoint[B](180:\aehlength){lB}
  \tkzDefShiftPoint[B](0:\aehlength){rB}
  \tkzDefPointWith[linear normed,K=-1](A,B) \tkzGetPoint{oA}
  \tkzDefPointWith[linear normed,K=-1](B,A) \tkzGetPoint{oB}
  \tkzDrawLines[add=.5 and .5,<->](oA,oB rA,lA rB,lB)
  \tkzDrawPoints(A,B,lA,rA,oA,rB,lB,oB)
  \tkzLabelPoints[above=3pt](A,B,lA,rA,rB,lB)
  \tkzLabelPoints[right=3pt](oA,oB)
  \tkzLabelAngle[pos=0.75](oA,A,lA) {$x$}
  \tkzLabelAngle[pos=0.75](lA,A,oA) {$x$}     
  \tkzLabelAngle[pos=0.75](oB,B,rB) {$60^\circ$}

\end{tikzpicture}
\end{document}

在此輸入影像描述

答案2

我不知道這是一個錯誤還是功能,但使用\tkzLabelAngle[pos=-0.45](lA,A,oA) {$x$}.請注意 中的減號pos

\documentclass[border=10pt]{standalone}
\usepackage{tkz-euclide}
\usetikzlibrary{arrows.meta}
\usetkzobj{all}

\newlength\aehlength
\setlength\aehlength{1in}

\begin{document}

\begin{tikzpicture}[my dot/.style={fill,circle,inner sep=1.5pt},>={To[scale=2]}]
  \coordinate (A) at (0,0);
  \coordinate (B) at (55:\aehlength);
  \coordinate (lA) at ($(A)+(180:\aehlength)$);
  \coordinate (rA) at ($(A)+(0:\aehlength)$);
  \coordinate (lB) at ($(B)+(180:\aehlength)$);
  \coordinate (rB) at ($(B)+(0:\aehlength)$);
  \coordinate (oA) at ($(A)!-1cm!(B)$);
  \coordinate (oB) at ($(B)!-1cm!(A)$);

  \foreach \mynA/\mypA/\mynB/\mypB in {A/2cm/B/2cm,lA/1cm/rA/1cm,lB/1cm/rB/1cm}
  {
    \draw[arrows=<->] ($(\mynA)!-\mypA!(\mynB)$) -- ($(\mynB)!-\mypB!(\mynA)$);
  }

  \foreach \myn/\myp in {A/90,B/90,lA/90,rA/90,lB/90,rB/90,oA/90,oB/90 }
  {
      \node[my dot] at (\myn) {};
      \node at ($(\myn)+(\myp:8pt)$) {\myn};
  }

  \tkzLabelAngle[pos=0.45](oA,A,lA) {$x$}
  \tkzLabelAngle[pos=-0.45](lA,A,oA) {$x$}         %%% <=== here
  \tkzLabelAngle[pos=0.75](oB,B,rB) {$60^\circ$}

\end{tikzpicture}
\end{document}

在此輸入影像描述

答案3

這是我的解決方案(定義我自己的角平分線):

\makeatletter
\newcommand\aeFindAngleBisector{\ae@find@angle@bisector}
\def\ae@find@angle@bisector(#1)(#2)(#3)[#4]{%%
  \bgroup
  \pgfmathanglebetweenpoints{\pgfpointanchor{#2}{center}}%%
                            {\pgfpointanchor{#1}{center}}%%
  \edef\ae@angle@start@position{\pgfmathresult}%%
  \pgfmathanglebetweenlines{\pgfpointanchor{#2}{center}}%%
                           {\pgfpointanchor{#1}{center}}%%
                           {\pgfpointanchor{#2}{center}}%%
                           {\pgfpointanchor{#3}{center}}%%
  \edef\ae@angle@between{\pgfmathresult}%%
  \pgfmathparse{(\ae@angle@start@position+\ae@angle@between/2}%%
  \xdef\ae@half@angle@bisector{\pgfmathresult}%%
  \coordinate (#4) at ($(#2)+(\ae@half@angle@bisector:10pt)$);
  \egroup
}%%
\makeatother

它採用一個角度ABC並沿角度平分線定義一個點,該點在角度內定義為圍繞頂點逆時針定義B

相關內容