1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
\input{preamble-standalone.ltx}
\begin{document}
% Ex. No. 189 (Section 22.5 : Determining a slope)
\begin{tikzpicture}[scale=1.5]
\tkzInit[xmax=4,ymax=5]\tkzGrid[sub]
\tkzDefPoint(1,2){A} \tkzDefPoint(3,4){B}
\tkzDefPoint(3,2){C} \tkzDefPoint(3,1){D}
\tkzDrawSegments(A,B A,C A,D)
\tkzDrawPoints[color=red](A,B,C,D)
\tkzLabelPoints(A,B,C,D)
\tkzFindSlope(A,B){SAB} \tkzFindSlope(A,C){SAC}
\tkzFindSlope(A,D){SAD}
\pgfkeys{/pgf/number format/.cd,fixed,precision=2}
\tkzText[fill=Gold!50,draw=brown](1,4)%
{The slope of (AB) is : $\pgfmathprintnumber{\SAB}$}
\tkzText[fill=Gold!50,draw=brown](1,3.5)%
{The slope of (AC) is : $\pgfmathprintnumber{\SAC}$}
\tkzText[fill=Gold!50,draw=brown](1,3)%
{The slope of (AD) is : $\pgfmathprintnumber{\SAD}$}
\end{tikzpicture}
\end{document}
|