summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/tkz-euclide/latex/TKZdoc-euclide-alea.tex
blob: 744c987d2fd6f5f8f635d7457da4da146ee4a73a (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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
%!TEX root = /Users/ego/Boulot/TKZ/tkz-euclide/doc_fr/TKZdoc-euclide-main.tex


\section{Définition aléatoire de points}
Il y a pour le moment quatre possibilités :
\begin{enumerate}
  \item point dans un rectangle,
  \item sur un segment,
  \item sur une droite,
  \item sur un cercle.
\end{enumerate}

\begin{NewMacroBox}{tkzGetRandPointOn}{\oarg{local options}\marg{name} }


\medskip
\begin{tabular}{lll}
\toprule
options     &     & définition                         \\ 
\midrule
\TOline{rectangle =  \#1 and \#2}{}{\#1 et \#2 sont des noms de points}
\TOline{segment =  \#1--\#2}{}{\#1 et \#2 sont des noms de points}
\TOline{line =  \#1--\#2}{}{\#1 et \#2 sont des noms de points}
\TOline{circle = center \#1 radius \#1 }{}{\#1 est un point et \#1 une mesure}
 \bottomrule
\end{tabular}

\medskip
\noindent\emph{Cette macro est assez simple à utiliser, voyez les exemples.}
\end{NewMacroBox} 

\subsection{Point aléatoire dans un rectangle} 

\begin{center}
\begin{tkzexample}[vbox]
\begin{tikzpicture}
  \tkzInit[xmax=5,ymax=5]  \tkzGrid   
  \tkzDefPoint(0,0){A}  \tkzDefPoint(2,2){B}
  \tkzDefPoint(5,5){C}
  \tkzGetRandPointOn[rectangle = A and B]{a}
  \tkzGetRandPointOn[rectangle = B and C]{d}
  \tkzDrawLine(a,d)
  \tkzDrawPoints(A,B,C,a,d) 
  \tkzLabelPoints(A,B,C,a,d)  
\end{tikzpicture} 
\end{tkzexample} 
\end{center}


\subsection{Point aléatoire sur un segment}  
\begin{tkzexample}[latex=6cm] 
\begin{tikzpicture}  
  \tkzInit[xmax=5,ymax=5] \tkzGrid   
  \tkzDefPoint(0,0){A} \tkzDefPoint(2,2){B}
  \tkzDefPoint(3,3){C} \tkzDefPoint(5,5){D}
  \tkzGetRandPointOn[segment = A--B]{a}
  \tkzGetRandPointOn[segment = C--D]{d}
  \tkzDrawPoints(A,B,C,D,a,d) 
  \tkzLabelPoints(A,B,C,D,a,d)
\end{tikzpicture} 
\end{tkzexample}

\subsection{Point aléatoire sur une droite}  
\begin{tkzexample}[latex=6cm] 
\begin{tikzpicture} 
  \tkzInit[xmax=5,ymax=5] \tkzGrid   
  \tkzDefPoint(0,0){A}  \tkzDefPoint(2,2){B}
  \tkzDefPoint(3,3){C}  \tkzDefPoint(5,5){D}
  \tkzGetRandPointOn[line = A--B]{a}
  \tkzGetRandPointOn[line = C--D]{d}
  \tkzDrawPoints(A,B,C,D,a,d) 
  \tkzLabelPoints(A,B,C,D,a,d)   
\end{tikzpicture}    
\end{tkzexample}

\subsection{Point aléatoire sur un cercle}  

\begin{tkzexample}[latex=5cm] 
\begin{tikzpicture} 
  \tkzInit[xmax=5,ymax=5]  \tkzGrid   
  \tkzDefPoint(3,2){A}  \tkzDefPoint(1,1){B}
  \tkzCalcLength[cm](A,B) \tkzGetLength{rAB}
  \tkzDrawCircle[R](A,\rAB cm) 
  \tkzGetRandPointOn[circle = center A radius \rAB cm]{a}
  \tkzDrawSegment(A,a)
  \tkzDrawPoints(A,B,a) 
  \tkzLabelPoints(A,B,a)  
\end{tikzpicture}
\end{tkzexample}


\newpage
\subsection{Milieu d'un segment au compas}  
 Pour terminer cette section, voici un exemple plus complexe. Il s'agit de déterminer le milieu d'un segment, uniquement avec un compas. 
 
\begin{center}
\begin{tkzexample}[vbox]
\begin{tikzpicture}[scale=.75]
  \tkzDefPoint(0,0){A}  
  \tkzGetRandPointOn[circle= center A radius 4cm]{B}
  \tkzDrawPoints(A,B)
  \tkzDefPointBy[rotation= center A angle 180](B) 
  \tkzGetPoint{C}
  \tkzInterCC[R](A,4 cm)(B,4 cm) 
  \tkzGetPoints{I}{I'}
  \tkzInterCC[R](A,4 cm)(I,4 cm) 
  \tkzGetPoints{J}{B}
  \tkzInterCC(B,A)(C,B) 
  \tkzGetPoints{D}{E}
  \tkzInterCC(D,B)(E,B) 
  \tkzGetPoints{M}{M'} 
  \tikzset{arc/.style={color=brown,style=dashed,delta=10}} 
  \tkzDrawArc[arc](C,D)(E) 
  \tkzDrawArc[arc](B,E)(D)
  \tkzDrawCircle[color=brown,line width=.2pt](A,B) 
  \tkzDrawArc[arc](D,B)(M) 
  \tkzDrawArc[arc](E,M)(B)
  \tkzCompasss[color=red,style=solid](B,I I,J J,C) 
  \tkzDrawPoints(B,C,D,E,M)    
 \end{tikzpicture}  
 \end{tkzexample}
\end{center}

\endinput