我知道可以在 tkz-euclide 中使用以下命令绘制三角形的内切圆:
\tkzDefCircle[in](A,B,C)\tkzGetPoint{I}\tkzGetLength{r}
\tkzDrawCircle[R](I,r pt)
有没有画三角形外圆的快捷方式?作为参考,这是三角形的三个外圆:
谢谢!
答案1
我实际上正在开发 tkz-euclide 的新版本。现在有 ex 圆圈
% tkz-euclide 的下一个版本发布时附带:
%tkzExCenter(A,B,C)
定义以 AB 为圆心的外圆点,
%\tkzDefCircle[ex](A,B,C)
表示以 AB 为中心点的圆,你得到一个点和一个半径
% 您还\tkzDrawCircle[ex](A,B,C)
% 例子
其实你可以这样做
\documentclass{article}
\usepackage{tkz-euclide} % loads TikZ and tkz-base
\usetkzobj{all}
\makeatletter
%<----------------------------------–>
% ExCenter
%<----------------------------------–>
\def\tkzExCenter(#1,#2,#3){%
\begingroup
\tkzDefBisectorOutLine(#1,#2,#3)\tkzGetPoint{tkz@bex2}
\tkzDefBisectorOutLine(#2,#1,#3)\tkzGetPoint{tkz@bex1}
\tkzInterLL(#1,tkz@bex1)(#2,tkz@bex2)
\endgroup
}
\def\tkzDefExCircle(#1,#2,#3){%
\begingroup
\tkzExCenter(#1,#2,#3) \tkzGetPoint{tkz@ea}
\tkzUProjection(#1,#2)(tkz@ea)
\tkzCalcLength(tkzPointResult,tkz@ea)
\tkzRenamePoint(tkz@ea){tkzPointResult}
\endgroup
}
\makeatother
\begin{document}
\begin{tikzpicture}[scale=.4]
\tkzInit[xmin=-10,xmax=10,ymin=-10,ymax=10]
\tkzClip[space=3]
\tkzDefPoint(0,0){A}
\tkzDefPoint(6,1){B}
\tkzDefPoint(1,4){C}
\tkzDrawLines[add=1 and 1](A,B A,C B,C)
\tkzDefExCircle(A,B,C) \tkzGetPoint{I} \tkzGetLength{rI}
\tkzDefExCircle(C,A,B) \tkzGetPoint{J} \tkzGetLength{rJ}
\tkzDefExCircle(B,C,A) \tkzGetPoint{K} \tkzGetLength{rK}
\tkzDrawPoints(I,J,K)
\tkzLabelPoints(A,B,C,I,J,K)
\tkzDrawPolygon(A,B,C)
\tkzDrawPoints(A,B,C)
\tkzDrawCircle[R](J,\rJ pt)
\tkzDrawCircle[R](I,\rI pt)
\tkzDrawCircle[R](K,\rK pt)
\end{tikzpicture}
\end{document}
答案2
只是为了比较,也可能是为了其他人阅读这个问题的利益,这里有一种在平原中生成外圆(和内圆)的方法元帖子如图所示:
prologues := 3;
outputtemplate := "%j%c.eps";
vardef incircle(expr A,B,C) =
save a,b,c,t; pair a,b,c,t;
a = A + unitvector(C-A)+unitvector(B-A);
b = B + unitvector(A-B)+unitvector(C-B);
c = whatever[A,a] = whatever [B,b]; t = whatever[A,B];
t-c = whatever * (B-A) rotated 90;
fullcircle scaled 2 abs(c-t) shifted c
enddef;
vardef excircle(expr A,B,C) =
save a,b,c,t; pair a,b,c,t;
a = A + (unitvector(C-A)+unitvector(B-A)) rotated 90;
b = B + (unitvector(A-B)+unitvector(C-B)) rotated 90;
c = whatever[A,a] = whatever [B,b]; t = whatever[A,B];
t-c = whatever * (B-A) rotated 90;
fullcircle scaled 2 abs(c-t) shifted c
enddef;
beginfig(1);
pair A, B, C;
A = origin;
B = 89 right rotated 10;
C = 55 right rotated 72;
fill A--B--C--cycle withcolor .87[blue,white];
path c[];
c1 = excircle(B,C,A);
c2 = excircle(C,A,B);
c3 = excircle(A,B,C);
draw c1 withcolor .53 red;
draw c2 withcolor .53 green;
draw c3 withcolor .53 blue;
drawoptions(withcolor .6 white);
draw A -- center c1;
draw B -- center c2;
draw C -- center c3;
draw center c1 -- center c2 -- center c3 -- cycle;
draw incircle(A,B,C);
drawoptions();
draw 2[A,B] -- 2[B,A];
draw 2[B,C] -- 2[C,B];
draw 3[C,A] -- 3[A,C];
label(btex $A$ etex, A - (10,10)); drawdot A withpen pencircle scaled dotlabeldiam;
label(btex $B$ etex, B + (18,-2)); drawdot B withpen pencircle scaled dotlabeldiam;
label(btex $C$ etex, C + (-4,10)); drawdot C withpen pencircle scaled dotlabeldiam;
dotlabel.urt (btex $a$ etex, center c1);
dotlabel.ulft(btex $b$ etex, center c2);
dotlabel.bot (btex $c$ etex, center c3);
endfig;
end.
笔记
该incircle
例程的工作原理是找到两个相邻内角平分线 ( ) 的交点和相应边上的c
切点 ( )。该例程完全相同,只是平分线旋转了 90°,这样我们就得到了外角平分线。t
excircle