summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/tkz-euclide/examples/tkzEuclide-15-1-3.tex
blob: 64d616fde2daf684edfe9c5a0224eb0fb126c47b (plain)
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
\input{preamble-standalone.ltx}
\begin{document}

% Ex. No. 83 (Section 15.1.3 : Example of adding dimensions (technical figure) option \tkzimp{dim})

   \begin{tikzpicture}[scale=2]
  \pgfkeys{/pgf/number format/.cd,fixed,precision=2}
  % Define the first two points
  \tkzDefPoint(0,0){A}
  \tkzDefPoint(3,0){B}
  \tkzDefPoint(1,1){C}
  % Draw the triangle and the points
  \tkzDrawPolygon(A,B,C)
  \tkzDrawPoints(A,B,C)
  % Label the sides
  \tkzCalcLength[cm](A,B)\tkzGetLength{ABl}
  \tkzCalcLength[cm](B,C)\tkzGetLength{BCl}
  \tkzCalcLength[cm](A,C)\tkzGetLength{ACl}
  % add dim
  \tkzDrawSegment[dim={\pgfmathprintnumber\BCl,
                  6pt,transform shape}](C,B)
  \tkzDrawSegment[dim={\pgfmathprintnumber\ACl,
                  6pt,transform shape}](A,C)
  \tkzDrawSegment[dim={\pgfmathprintnumber\ABl,
                  -6pt,transform shape}](A,B)
\end{tikzpicture}

\end{document}