答案1
一个解决方案(如果它是通过开关(MiKTeX)或(TeX Live,MacTeX)启动的pstricks
,则可以使用它来编译它) :pdf-latex
--enable-write18
-shell-escape
\documentclass[12pt, x11names]{article}%
\usepackage{pstricks-add}
\usepackage{pst-eucl}
\usepackage{auto-pst-pdf}
\begin{document}
\psset{unit=10,dotsize = 3pt}
\begin{pspicture}(-3,-1.5)(3,2.5)
\pstGeonode[PosAngle=180,linecolor=LightSteelBlue3](0,0){A}%(1;45){R}
\pstGeonode[linecolor=LightSteelBlue3](1,0){B}
{\psset{PointSymbol=none, PointName=none}
\pstRotation[RotAngle=45]{A}{B}[R]
\pstRotation[RotAngle=-60]{B}{A}[T] }
\pstInterLL[PosAngle=90, linecolor=LightSteelBlue3]{A}{R}{B}{T}{C}
\pspolygon[linecolor=LightSteelBlue3](A)(B)(C)
%% Bissectors
{\psset{PointSymbol=none, PointName=none, linestyle=none}
\pstBissectBAC{C}{B}{A}{B1}
\pstBissectBAC{A}{C}{B}{C1}}
\pstInterLL{B}{B1}{C}{C1}{I}
\psline(A)(I)(B)\psline(I)(C)
%%%Centres
\psset{linestyle=none}
\pstCircleABC{A}{B}{C}{O}\pstCGravABC{A}{B}{C}{G}
\pstCircleABC{B}{I}{C}{O1}\pstCGravABC{B}{I}{C}{G1}
\pstCircleABC{C}{I}{A}{O2}\pstCGravABC{I}{C}{A}{G2}
\pstCircleABC{A}{I}{B}{O3}\pstCGravABC{A}{I}{B}{G3}
%%%Euler lines
\psset{linestyle=solid, linecolor=red, nodesep=0.5,nodesepA=1}
\pstLineAB[,nodesepA=0.5]{O}{G}
\pstLineAB{O1}{G1}
\pstLineAB{O2}{G2}
\pstLineAB{O3}{G3}
\color{DarkOrange3}\boldmath\pstInterLL[PointSymbol=o, PosAngle=-30]{O}{G}{O1}{G1}{S}
\end{pspicture}
\end{document}
答案2
这里是一片平原元帖子方法,whatever
在我能想到的尽可能多的地方突出了“精彩”这个关键词。这里使用的大多数几何技术都是在《METAFONT 手册。
ACB
我认为当我将角度设为略大于直角时看起来会更好,这样三角形的欧拉线ABC
就不会通过点C
。最后的操作只是将图片剪裁成一个漂亮的矩形。
prologues:=3;
outputtemplate:="%j%c.eps";
vardef centroid(expr a, b, c) =
save m; pair m; m = whatever [a, 1/2[b,c]] = whatever [b, 1/2[a,c]]; m
enddef;
vardef circumcenter(expr a, b, c) =
save m; pair m;
m = whatever [a,b] rotatedaround(1/2[a,b],90)
= whatever [b,c] rotatedaround(1/2[b,c],90); m
enddef;
vardef orthocenter(expr a, b, c) =
save m,p,q,r; pair m, p, q, r;
p = whatever[b,c]; p-a = whatever * (c-b) rotated 90;
q = whatever[c,a]; q-b = whatever * (a-c) rotated 90;
r = whatever[a,b]; r-c = whatever * (b-a) rotated 90;
m = whatever[a,p] = whatever[b,q]; m
enddef;
vardef incenter(expr a,b,c) =
save m; pair m;
m = whatever [a,b] rotatedaround(a, 1/2 (angle (c-a) - angle (b-a) ) )
= whatever [b,c] rotatedaround(b, 1/2 (angle (a-b) - angle (c-b) ) ); m
enddef;
% how high is c given a--b as a base?
vardef altitude(expr a,b,c) =
save p; pair p;
p = whatever[a,b]; p-c = whatever * (b-a) rotated 90;
length(p-c)
enddef;
newinternal lt_overshoot; lt_overshoot := 10;
vardef line_through (expr a, b) =
pair t; t = unitvector(b-a) scaled lt_overshoot;
-t shifted a -- t shifted b
enddef;
% Allow en_GB spelling of centre
def circumcentre = circumcenter enddef;
def orthocentre = orthocenter enddef;
def incentre = incenter enddef;
vardef euler_line(expr a,b,c) =
line_through(circumcenter(a,b,c),orthocenter(a,b,c))
enddef;
beginfig(1);
pair A, B, C;
A = origin;
B = 264 right;
C = quartercircle scaled 400
intersectionpoint
quartercircle rotated 90 scaled 300 shifted B;
pair I; I = incenter(A,B,C);
draw fullcircle scaled 2 altitude(A,B,I) shifted I dashed withdots scaled 1/3 withcolor .7 white;
draw A--B--C--cycle;
draw A--I;
draw B--I;
draw C--I;
path e[];
e0 = euler_line(A,B,C);
e1 = euler_line(A,B,I);
e2 = euler_line(B,C,I);
e3 = euler_line(C,A,I);
pair S;
S = e0 intersectionpoint e1;
for i=0 upto 3:
draw e[i] withcolor .67 red;
endfor
draw fullcircle scaled 4 shifted S;
label(btex $S$ etex, S + 12 right);
dotlabel.lft(btex $A$ etex, A);
dotlabel.rt (btex $B$ etex, B);
dotlabel.urt(btex $C$ etex, C);
dotlabel.urt(btex $I$ etex, I);
currentpicture := currentpicture shifted -S;
setbounds currentpicture to unitsquare shifted -(1/2,2/5) xscaled 377 yscaled 233;
endfig;
end
答案3
正如 Percusse 在评论中所说,tkz-euclide
只有法语文档,但示例非常简单,尤其是因为每个示例的代码始终存在并且命令都是英文的。在文档中搜索命令通常会为您带来解决方案。
为了加载该包,您需要将其添加到您的序言中(第二个命令是加载库):
\usepackage{tkz-euclide}
\usetkzobj{all}
由于它基于 TikZ,因此您需要将其封装在环境中tikzpicture
。实际上,它可以与 TikZ 一起工作,但使用此包计算点/线通常更容易,而 TikZ 可能需要更多手动工作(不过这取决于具体情况)。
我的代码基本上设置了三角形 ABC。从中,你可以得到三角形内心然后绘制相关线段。以下示例提供了这些内容,以便您了解如何获得积分至于欧拉线,根据定义,它们是通过三角形相对的几个点的线,其中一些是:
- 这垂心
- 这外心
- 这质心
- 这埃克塞特角
- 这九点圆心
要形成一条线,任何线,你只需要二点。我设法为每个三角形获取了前三个点。尽管在图中,我只使用了外心和垂心。
输出
代码
\documentclass[margin=10pt]{standalone}
\usepackage{tkz-euclide}
\usetkzobj{all}
\begin{document}
\begin{tikzpicture}[label style/.style={font=\scriptsize}]
\clip (-1,-1) rectangle (6,4);
\tkzDefPoints{%
0/0/A,
5/0/B,
3.5/3/C}
\tkzDrawPolygon[blue](A,B,C)
\tkzInCenter(A,B,C)\tkzGetPoint{I}
\tkzDrawSegments[blue](A,I B,I C,I)
For triangle ABC
\tkzCentroid(A,B,C)\tkzGetPoint{ABCc}
\tkzCircumCenter(A,B,C)\tkzGetPoint{ABCcc}
\tkzOrthoCenter(A,B,C)\tkzGetPoint{ABCo}
% For triangle ACI
\tkzCentroid(A,C,I)\tkzGetPoint{ACIc}
\tkzCircumCenter(A,C,I)\tkzGetPoint{ACIcc}
\tkzOrthoCenter(A,C,I)\tkzGetPoint{ACIo}
% For triangle ABI
\tkzCentroid(A,B,I)\tkzGetPoint{ABIc}
\tkzCircumCenter(A,B,I)\tkzGetPoint{ABIcc}
\tkzOrthoCenter(A,B,I)\tkzGetPoint{ABIo}
% For triangle CBI
\tkzCentroid(C,B,I)\tkzGetPoint{CBIc}
\tkzCircumCenter(C,B,I)\tkzGetPoint{CBIcc}
\tkzOrthoCenter(C,B,I)\tkzGetPoint{CBIo}
\tkzDrawSegments[red](ACIcc,ACIo ABIcc,ABIo)
\tkzDrawLines[color=red,add = .7 and .5](CBIo,CBIcc ABCcc,ABCo)
\tkzInterLL(ACIcc,ACIo)(ABIcc,ABIo) \tkzGetPoint{S}
\tkzDrawPoints[color=red,fill=white](S)
\tkzDrawPoints[color=blue, fill=white](A,B,C,I)
\tkzLabelPoints[above left](S)
\tkzLabelPoints[below left](A)
\tkzLabelPoints[above](C)
\tkzLabelPoints[below right](B)
\tkzLabelPoints[above right](I)
\end{tikzpicture}
\end{document}