这是我的代码
\documentclass[border=2mm]{standalone}
\usepackage{tkz-euclide} % loads TikZ
\begin{document}
\begin{tikzpicture}
\pgfmathsetmacro{\a}{2}
\tkzDefPoint(0,0){O}
\tkzDefPoint(-\a,0){A}
\tkzDefPoint(\a,0){B}
%\tkzDefCircle[through](O,C)
\tkzDrawCircle(O,A)
\tkzGetLength{rO}
\tkzDefPointOnCircle[angle=130,center=O,radius=\rO pt]
\tkzGetPoint{C}
\tkzDefPointOnCircle[angle=80,center=O,radius=\rO pt]
\tkzGetPoint{D}
\tkzDefPointOnCircle[angle=40,center=O,radius=\rO pt]
\tkzGetPoint{E}
\tkzDefPointBy[symmetry=center C](A) \tkzGetPoint{M}
\tkzDefPointBy[symmetry=center D](A) \tkzGetPoint{N}
\tkzDefPointBy[symmetry=center E](A) \tkzGetPoint{P}
\tkzDrawPoints(A,B,C,M,O,N,P,C,D,E)
\tkzDrawSegments(A,M A,N A,P A,B)
\tkzMarkSegments[mark=|](A,C M,C)
\tkzMarkSegments[mark=||](A,D D,N)
\tkzMarkSegments[mark=|||](A,E E,P)
\foreach \p/\g in {A/180,B/0,M/90,O/-90,N/90,P/90,C/120,D/90,E/90}
\path (\p)+(\g:3mm) node{$\p$};
\end{tikzpicture}
\end{document}
我有
我怎样才能得到正确的结果?
答案1
使用最新版本 tkz-euclide 5.02c
\tkzGetLength{rO} is wrong
p.17 0.3. 与以前版本的变化
\tkzCalcLength
\tkzGetLength
以厘米为单位给出结果;
备注:你定义的宏 \a, \rOA 没有用
`\tkzDefPointOnCircle[angle=130,center=O,radius=\rOA pt]` replaced by `\tkzDefPointOnCircle[R= center O angle 130 radius \rOA]`
代码
\documentclass[border=2mm]{standalone}
\usepackage{tkz-euclide} % loads TikZ
\begin{document}
\begin{tikzpicture}
\pgfmathsetmacro{\a}{2}
\tkzDefPoint(0,0){O}
\tkzDefPoint(-\a,0){A}
\tkzDefPoint(\a,0){B}
%\tkzDefCircle[through](O,C)
\tkzDrawCircle(O,A)
%%%%%%%%%%%%%%%%%%%%%%
%\tkzGetLength{rO}<--- wrong
%
% \tkzCalcLength(O,A)\tkzGetLength{rOA}%<-- not useful
%
%\tkzDefPointOnCircle[angle=130,center=O,radius=\rOA pt]
\tkzDefPointOnCircle[R= center O angle 130 radius \a]
%
\tkzGetPoint{C}
%\tkzDefPointOnCircle[angle=80,center=O,radius=\rO pt]
\tkzDefPointOnCircle[R= center O angle 60 radius \a]
\tkzGetPoint{D}
%\tkzDefPointOnCircle[angle=40,center=O,radius=\rO pt]
\tkzDefPointOnCircle[R= center O angle 40 radius \a]
%
\tkzGetPoint{E}
\tkzDefPointBy[symmetry=center C](A) \tkzGetPoint{M}
\tkzDefPointBy[symmetry=center D](A) \tkzGetPoint{N}
\tkzDefPointBy[symmetry=center E](A) \tkzGetPoint{P}
\tkzDrawPoints(A,B,C,M,O,N,P,C,D,E)
\tkzDrawSegments(A,M A,N A,P A,B)
\tkzMarkSegments[mark=|](A,C M,C)
\tkzMarkSegments[mark=||](A,D D,N)
\tkzMarkSegments[mark=|||](A,E E,P)
\foreach \p/\g in {A/180,B/0,M/90,O/-90,N/90,P/90,C/120,D/90,E/90}
\path (\p)+(\g:3mm) node{$\p$};
\end{tikzpicture}
\end{document}