summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/tkz/tkz-euclide/doc/latex/TKZdoc-euclide-drawing.tex
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex/contrib/tkz/tkz-euclide/doc/latex/TKZdoc-euclide-drawing.tex')
-rw-r--r--macros/latex/contrib/tkz/tkz-euclide/doc/latex/TKZdoc-euclide-drawing.tex72
1 files changed, 54 insertions, 18 deletions
diff --git a/macros/latex/contrib/tkz/tkz-euclide/doc/latex/TKZdoc-euclide-drawing.tex b/macros/latex/contrib/tkz/tkz-euclide/doc/latex/TKZdoc-euclide-drawing.tex
index e4d08474d0..181285901c 100644
--- a/macros/latex/contrib/tkz/tkz-euclide/doc/latex/TKZdoc-euclide-drawing.tex
+++ b/macros/latex/contrib/tkz/tkz-euclide/doc/latex/TKZdoc-euclide-drawing.tex
@@ -255,25 +255,61 @@ This is of course equivalent to \tkzcname{draw (A)--(B);}. You can also use the
\end{tikzpicture}
\end{tkzexample}
+\subsubsection{Adding dimensions with option \tkzname{dim} new code from Muzimuzhi Z}
+This code comes from an answer to this question on tex.stackexchange.com
+(change-color-and-style-of-dimension-lines-in-tkz-euclide )
+You can use now two styles : |dim style| and |dim fence style|. You have several ways to use them.
+I'll let you look at the examples to see what you can do with these styles.
+
+\begin{verbatim}
+ \tikzset{dim style/.append style={dashed}} % append if you want to keep precedent style.
+ or
+ \begin{scope}[ dim style/.append style={orange},
+ dim fence style/.style={dashed}]
+\end{verbatim}
+
+
+\begin{tkzexample}[latex=7cm]
+\begin{tikzpicture}[scale=.75]
+ \tkzDefPoints{0/3/A, 1/-3/B}
+ \tkzDrawPoints(A,B)
+ \tkzDrawSegment[dim={\(l_0\),1cm,right=2mm},
+ dim style/.append style={red,
+ dash pattern={on 2pt off 2pt}}](A,B)
+ \tkzDrawSegment[dim={\(l_1\),2cm,right=2mm},
+ dim style/.append style={blue}](A,B)
+ \begin{scope}[ dim style/.style={orange},
+ dim fence style/.style={dashed}]
+ \tkzDrawSegment[dim={\(l_2\),3cm,right=2mm}](A,B)
+ \tkzDrawSegment[dim={\(l_3\),-2cm,right=2mm}](A,B)
+ \end{scope}
+ \tkzLabelPoints[left](A,B)
+\end{tikzpicture}
+\end{tkzexample}
+
+
\subsubsection{Adding dimensions with option \tkzname{dim} partI}
-\begin{tkzexample}[vbox,small]
-\begin{tikzpicture}[scale=4]
- \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(A,B)\tkzGetLength{ABl}
- \tkzCalcLength(B,C)\tkzGetLength{BCl}
- \tkzCalcLength(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)
+\begin{tkzexample}[latex=7cm,small]
+\begin{tikzpicture}[scale=2]
+\pgfkeys{/pgf/number format/.cd,fixed,precision=2}
+\tkzDefPoint(0,0){A}
+\tkzDefPoint(3.07,0){B}
+\tkzInterCC[R](A,2.37)(B,1.82)
+\tkzGetPoints{C}{C'}
+\tkzDrawCircle[in](A,B,C) \tkzGetPoint{G}
+\tkzGetLength{rIn}
+\tkzDrawPolygon(A,B,C)
+\tkzDrawPoints(A,B,C)
+\tkzCalcLength(A,B)\tkzGetLength{ABl}
+\tkzCalcLength(B,C)\tkzGetLength{BCl}
+\tkzCalcLength(A,C)\tkzGetLength{ACl}
+\begin{scope}[dim style/.style={dashed,sloped,teal}]
+ \tkzDrawSegment[dim={\pgfmathprintnumber\BCl,6pt,
+ text=red}](C,B)
+ \tkzDrawSegment[dim={\pgfmathprintnumber\ACl,6pt,}](A,C)
+ \tkzDrawSegment[dim={\pgfmathprintnumber\ABl,-6pt,}](A,B)
+\end{scope}
+\tkzLabelPoints(A,B) \tkzLabelPoints[above](C)
\end{tikzpicture}
\end{tkzexample}