在下图中,我尝试标记 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 版本 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
。