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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
|
\section{Sectors}
\subsection{\tkzcname{tkzDrawSector}}
\tkzHandBomb\ Attention the arguments vary according to the options.
\begin{NewMacroBox}{tkzDrawSector}{\oarg{local options}\parg{O,\dots}\parg{\dots}}%
\begin{tabular}{lll}%
options & default & definition \\
\midrule
\TOline{towards}{towards}{$O$ is the center and the arc from $A$ to $(OB)$}
\TOline{rotate} {towards}{the arc starts from $A$ and the angle determines its length }
\TOline{R}{towards}{We give the radius and two angles}
\TOline{R with nodes}{towards}{We give the radius and two points}
\bottomrule
\end{tabular}
\medskip
You have to add, of course, all the styles of \TIKZ\ for tracings...
\medskip
\begin{tabular}{lll}%
\toprule
options & arguments & example \\
\midrule
\TOline{towards}{\parg{pt,pt}\parg{pt}}{\tkzcname{tkzDrawSector(O,A)(B)}}
\TOline{rotate} {\parg{pt,pt}\parg{an}}{\tkzcname{tkzDrawSector[rotate,color=red](O,A)(90)}}
\TOline{R}{\parg{pt,$r$}\parg{an,an}}{\tkzcname{tkzDrawSector[R,color=blue](O,2 cm)(30,90)}}
\TOline{R with nodes}{\parg{pt,$r$}\parg{pt,pt}}{\tkzcname{tkzDrawSector[R with nodes](O,2 cm)(A,B)}}
\bottomrule
\end{tabular}
\end{NewMacroBox}
Here are a few examples:
\subsubsection{\tkzcname{tkzDrawSector} and \tkzname{towards}}
There's no need to put \tkzname{towards}. You can use \tkzname{fill} as an option.
\begin{tkzexample}[latex=7cm,small]
\begin{tikzpicture}[scale=1]
\tkzDefPoint(0,0){O}
\tkzDefPoint(-30:3){A}
\tkzDefPointBy[rotation = center O angle -60](A)
\tkzDrawSector[fill=red!50](O,A)(tkzPointResult)
\begin{scope}[shift={(-60:1cm)}]
\tkzDefPoint(0,0){O}
\tkzDefPoint(-30:3){A}
\tkzDefPointBy[rotation = center O angle -60](A)
\tkzDrawSector[fill=blue!50](O,tkzPointResult)(A)
\end{scope}
\end{tikzpicture}
\end{tkzexample}
\subsubsection{\tkzcname{tkzDrawSector} and \tkzname{rotate}}
\begin{tkzexample}[latex=7cm,small]
\begin{tikzpicture}[scale=2]
\tkzDefPoint(0,0){O}
\tkzDefPoint(2,2){A}
\tkzDrawSector[rotate,draw=red!50!black,%
fill=red!20](O,A)(30)
\tkzDrawSector[rotate,draw=blue!50!black,%
fill=blue!20](O,A)(-30)
\end{tikzpicture}
\end{tkzexample}
\subsubsection{\tkzcname{tkzDrawSector} and \tkzname{R}}
\begin{tkzexample}[latex=7cm,small]
\begin{tikzpicture}[scale=1.25]
\tkzDefPoint(0,0){O}
\tkzDefPoint(2,-1){A}
\tkzDrawSector[R,draw=white,%
fill=red!50](O,2cm)(30,90)
\tkzDrawSector[R,draw=white,%
fill=red!60](O,2cm)(90,180)
\tkzDrawSector[R,draw=white,%
fill=red!70](O,2cm)(180,270)
\tkzDrawSector[R,draw=white,%
fill=red!90](O,2cm)(270,360)
\end{tikzpicture}
\end{tkzexample}
\subsubsection{\tkzcname{tkzDrawSector} and \tkzname{R}}
\begin{tkzexample}[latex=7cm,small]
\begin{tikzpicture}[scale=1.25]
\tkzDefPoint(0,0){O}
\tkzDefPoint(4,-2){A}
\tkzDefPoint(4,1){B}
\tkzDefPoint(3,3){C}
\tkzDrawSector[R with nodes,%
fill=blue!20](O,1 cm)(B,C)
\tkzDrawSector[R with nodes,%
fill=red!20](O,1.25 cm)(A,B)
\tkzDrawSegments(O,A O,B O,C)
\tkzDrawPoints(O,A,B,C)
\tkzLabelPoints(A,B,C)
\tkzLabelPoints[left](O)
\end{tikzpicture}
\end{tkzexample}
\subsubsection{\tkzcname{tkzDrawSector} and \tkzname{R with nodes}}
\begin{tkzexample}[latex=7cm,small]
\begin{tikzpicture} [scale=.5]
\tkzDefPoint(-1,-2){A}
\tkzDefPoint(1,3){B}
\tkzDefRegPolygon[side,sides=6](A,B)
\tkzGetPoint{O}
\tkzDrawPolygon[fill=black!10,
draw=blue](P1,P...,P6)
\tkzLabelRegPolygon[sep=1.05](O){A,...,F}
\tkzDrawCircle[dashed](O,A)
\tkzLabelSegment[above,sloped,
midway](A,B){\(A B = 16m\)}
\foreach \i [count=\xi from 1] in {2,...,6,1}
{%
\tkzDefMidPoint(P\xi,P\i)
\path (O) to [pos=1.1] node {\xi} (tkzPointResult) ;
}
\tkzDefRandPointOn[segment = P3--P5]
\tkzGetPoint{S}
\tkzDrawSegments[thick,dashed,red](A,S S,B)
\tkzDrawPoints(P1,P...,P6,S)
\tkzLabelPoint[left,above](S){$S$}
\tkzDrawSector[R with nodes,fill=red!20](S,2 cm)(A,B)
\tkzLabelAngle[pos=1.5](A,S,B){$\alpha$}
\end{tikzpicture}
\end{tkzexample}
\subsection{\tkzcname{tkzFillSector}}
\tkzHandBomb\ Attention the arguments vary according to the options.
\begin{NewMacroBox}{tkzFillSector}{\oarg{local options}\parg{O,\dots}\parg{\dots}}%
\begin{tabular}{lll}%
options & default & definition \\
\midrule
\TOline{towards}{towards}{$O$ is the center and the arc from $A$ to $(OB)$}
\TOline{rotate} {towards}{the arc starts from A and the angle determines its length }
\TOline{R}{towards}{We give the radius and two angles}
\TOline{R with nodes}{towards}{We give the radius and two points}
\bottomrule
\end{tabular}
\medskip
Of course, you have to add all the styles of \TIKZ\ for the tracings...
\medskip
\begin{tabular}{lll}%
\toprule
options & arguments & example \\
\midrule
\TOline{towards}{\parg{pt,pt}\parg{pt}}{\tkzcname{tkzFillSector(O,A)(B)}}
\TOline{rotate} {\parg{pt,pt}\parg{an}}{\tkzcname{tkzFillSector[rotate,color=red](O,A)(90)}}
\TOline{R}{\parg{pt,$r$}\parg{an,an}}{\tkzcname{tkzFillSector[R,color=blue](O,2 cm)(30,90)}}
\TOline{R with nodes}{\parg{pt,$r$}\parg{pt,pt}}{\tkzcname{tkzFillSector[R with nodes](O,2 cm)(A,B)}}
\end{tabular}
\end{NewMacroBox}
\subsubsection{\tkzcname{tkzFillSector} and \tkzname{towards}}
It is useless to put \tkzname{towards} and you will notice that the contours are not drawn, only the surface is colored.
\begin{tkzexample}[latex=5.75cm,small]
\begin{tikzpicture}[scale=.6]
\tkzDefPoint(0,0){O}
\tkzDefPoint(-30:3){A}
\tkzDefPointBy[rotation = center O angle -60](A)
\tkzFillSector[fill=red!50](O,A)(tkzPointResult)
\begin{scope}[shift={(-60:1cm)}]
\tkzDefPoint(0,0){O}
\tkzDefPoint(-30:3){A}
\tkzDefPointBy[rotation = center O angle -60](A)
\tkzFillSector[color=blue!50](O,tkzPointResult)(A)
\end{scope}
\end{tikzpicture}
\end{tkzexample}
\subsubsection{\tkzcname{tkzFillSector} and \tkzname{rotate}}
\begin{tkzexample}[latex=5.75cm,small]
\begin{tikzpicture}[scale=1.5]
\tkzDefPoint(0,0){O} \tkzDefPoint(2,2){A}
\tkzFillSector[rotate,color=red!20](O,A)(30)
\tkzFillSector[rotate,color=blue!20](O,A)(-30)
\end{tikzpicture}
\end{tkzexample}
\subsection{\tkzcname{tkzClipSector}}
\tkzHandBomb\ Attention the arguments vary according to the options.
\begin{NewMacroBox}{tkzClipSector}{\oarg{local options}\parg{O,\dots}\parg{\dots}}%
\begin{tabular}{lll}%
options & default & definition \\
\midrule
\TOline{towards}{towards}{$O$ is the centre and the sector starts from $A$ to $(OB)$}
\TOline{rotate} {towards}{The sector starts from $A$ and the angle determines its amplitude. }
\TOline{R}{towards}{We give the radius and two angles}
\bottomrule
\end{tabular}
\medskip
You have to add, of course, all the styles of \TIKZ\ for tracings...
\medskip
\begin{tabular}{lll}%
\toprule
options & arguments & example \\
\midrule
\TOline{towards}{\parg{pt,pt}\parg{pt}}{\tkzcname{tkzClipSector(O,A)(B)}}
\TOline{rotate} {\parg{pt,pt}\parg{angle}}{\tkzcname{tkzClipSector[rotate](O,A)(90)}}
\TOline{R}{\parg{pt,$r$}\parg{angle 1,angle 2}}{\tkzcname{tkzClipSector[R](O,2 cm)(30,90)}}
\end{tabular}
\end{NewMacroBox}
\subsubsection{\tkzcname{tkzClipSector}}
\begin{tkzexample}[latex=7cm,small]
\begin{tikzpicture}[scale=1.5]
\tkzDefPoint(0,0){O}
\tkzDefPoint(2,-1){A}
\tkzDefPoint(1,1){B}
\tkzDrawSector[color=blue,dashed](O,A)(B)
\tkzDrawSector[color=blue](O,B)(A)
\tkzClipBB
\begin{scope}
\tkzClipSector(O,B)(A)
\draw[fill=gray!20] (-1,0) rectangle (3,3);
\end{scope}
\tkzDrawPoints(A,B,O)
\end{tikzpicture}
\end{tkzexample}
\endinput
|