tikz与tkz-euclide包绘制平面几何图形1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32\documentclass[tikz]{standalone}
\usepackage{newtxmath}
\usepackage{tkz-euclide}
\usetkzobj{all}
\usetikzlibrary{arrows.meta,intersections}
\begin{document}
\def\n{1.25}
\begin{tikzpicture}[>=Stealth,semithick,scale=0.6]
\draw[->](-8,0)--(0,0)coordinate(O)node[below left]{$O$}--(8,0)node[below]{$x$};
\draw[->](0,-1.5)--(0,10)node[left]{$y$};
\draw[samples=200,domain=-0.5:1.33]plot({1.2*sec(\x r)},{2.4*tan(\x r)});
\draw[samples=200,domain=-0.5:1.33,xscale=-1]plot({1.2*sec(\x r)},{2.4*tan(\x r)});
\fill({1.2*sec(\n r)},{2.4*tan(\n r)})coordinate(P)node[left]{$P$}circle(1pt);
\fill(2.64,0)coordinate(F2)node[below]{$F_2$}circle(1pt)
(-2.64,0)coordinate(F1)node[below]{$F_1$}circle(1pt)(O)circle(1pt);
\draw(F1)--(P)--(F2);
\tkzInCenter(P,F1,F2)\tkzGetPoint{I}
\fill(I)node[left]{$I$}circle(1pt);
\tkzDefPointBy[projection=onto F1--F2](I)
\tkzGetPoint{D}
\tkzDefPointBy[projection=onto P--F2](I)
\tkzGetPoint{E}
\tkzDefPointBy[projection=onto F1--P](I)
\tkzGetPoint{F}
\tkzDrawCircle[color=magenta,dashed](I,D)
\draw(D)--(I)--(E)(I)--(F);
\fill(D)circle(1pt)(E)circle(1pt)(F)circle(1pt);
\tkzMarkRightAngle[fill=cyan!10](I,D,F1)
\tkzMarkRightAngle[fill=cyan!10](I,E,P)
\tkzMarkRightAngle[fill=cyan!10](I,F,F1)
\end{tikzpicture}
\end{document}