9 pair c,pos; c := (0,0); pos := c;
11 label.bot(btex $n=1$ etex, pos);
15 A[0] := (-0.3cm, -0.2cm)+c; A[1] := (0.2cm, 0.3cm)+c;
17 drawemptyvertex(A[0]); drawemptyvertex(A[1]);
18 label.bot(btex $n=2$ etex, pos);
21 A[2] := (+0.3cm, -0.4cm)+c;
22 for i := 0 upto 2: A[i] := A[i] shifted c; endfor
23 draw A[0]--A[1]--A[2]--cycle;
24 for i := 0 upto 2: drawemptyvertex(A[i]); endfor
25 label.bot(btex $n=3$ etex, pos);
28 A[3] := (A[0]+A[1]+A[2])/3;
29 for i := 0 upto 3: A[i] := A[i] shifted c; endfor
30 draw A[0]--A[1]--A[2]--cycle;
31 for i := 0 upto 2: drawemptyvertex(A[i]); endfor
36 A[3] := A[1]+(0.3cm,-0.2cm);
37 for i := 0 upto 3: A[i] := A[i] shifted c; endfor
38 draw A[0]--A[1]--A[3]--A[2]--cycle;
39 for i := 0 upto 3: drawemptyvertex(A[i]); endfor
40 label.bot(btex $n=4$ etex, pos);
43 figtag("pridani_bodu");
45 pair A[],B[],C,shift; shift := (4.5cm,0);
46 A[0] := (-1.7cm,1.1cm);
47 A[1] := (-1.2cm,1.2cm);
49 A[3] := (0.2cm,0.2cm);
50 A[4] := (0.4cm,-0.7cm);
51 A[5] := (-0.8cm,-1.3cm);
52 A[6] := (-1.4cm,-1.4cm);
53 B[0] := (-1.1cm, 0.7cm);
54 B[1] := (-0.6cm, 0.1cm);
55 B[2] := (-1.3cm, -0.6cm);
60 draw A[0] for i := 1 upto 6: --A[i] endfor;
61 for i := 1 upto 5: drawemptyvertex(A[i]); endfor
62 for i := 0 upto 2: draw vertex(B[i]); endfor
64 drawarrow (C+(0.5cm,0)--C+(1.5cm,0)) shifted (0, -0.1cm) withpen normalpen;
65 for i:=0 upto 6: A[i] := A[i] shifted shift; endfor
66 for i:=0 upto 2: B[i] := B[i] shifted shift; endfor
70 draw A[0] for i := 1 upto 6: --A[i] endfor;
73 draw C--A[2] dashed evenly withpen normalpen;
74 draw C--A[3] dashed evenly withpen normalpen;
75 for i := 1 upto 5: drawemptyvertex(A[i]); endfor
76 for i := 0 upto 2: draw vertex(B[i]); endfor
78 drawarrow (C+(0.5cm,0)--C+(1.5cm,0)) shifted (0,-0.1cm) withpen normalpen;
79 for i:=0 upto 6: A[i] := A[i] shifted shift; endfor
80 for i:=0 upto 2: B[i] := B[i] shifted shift; endfor
84 draw for i := 0 upto 2: A[i]-- endfor C for i := 4 upto 6: --A[i] endfor;
85 for i := 1 upto 2: drawemptyvertex(A[i]); endfor
86 for i := 4 upto 5: drawemptyvertex(A[i]); endfor
87 for i := 0 upto 2: draw vertex(B[i]); endfor
98 A[1] := (-6.2cm, 0.9cm);
99 A[2] := (-4.6cm,1.5cm);
100 A[3] := (-2.4cm,1.8cm);
101 A[4] := (-0.8cm,1.5cm);
102 A[5] := (0.4cm,0.6cm);
103 A[6] := (0.8cm,-0.10cm);
104 A[7] := (-1.6cm,-1.9cm);
105 A[8] := (-4cm,-2.1cm);
106 A[9] := (-6cm, -1.5cm);
107 A[10] := (-7cm, 0cm);
109 B[0] := (-2.2cm, 0.7cm);
110 B[1] := (-1.2cm, 0.1cm);
111 B[2] := (-2.6cm, -0.6cm);
112 B[3] := (-3.6cm, -0.4cm);
113 B[4] := (-3cm, 0.6cm);
114 B[5] := (-2.6cm, 1cm);
115 B[6] := (-1cm, -1.2cm);
116 B[7] := (-6.5cm, 0.2cm);
117 B[8] := (-5cm, 0.8cm);
118 B[9] := (-6cm, -0.6cm);
119 B[10] := (-5cm, -1.2cm);
121 draw createpath(for i := 0 upto 5: A[i]-- endfor A[6]);
122 draw (for i := 6 upto 9: A[i]-- endfor A[10]) dashed evenly;
123 for i := 0 upto 9: drawemptyvertex(A[i]); endfor
124 for i := 0 upto 10: draw vertex(B[i]); endfor
126 label(btex \font\myfont=csr10 \myfont horní obálka etex, ((-7cm+0.8cm)/2,2.2cm));
127 label(btex \font\myfont=csr10 \myfont dolní obálka etex, ((-7cm+0.8cm)/2,-2.5cm));
128 label.lft(btex $L$ etex, A[0]);
129 label.rt(btex $P$ etex, A[6]);
132 figtag("determinant");
134 labeloffset := 0.1cm;
135 pair A[], shift; shift := (4cm,1cm);
140 A[2] := (1.5cm, 0cm);
141 A[3] := A[0] + A[2] - A[1];
143 fill A[0]--A[1]--A[2]--A[3]--cycle withcolor 0.8white;
144 draw A[0]--A[1]--A[2]--A[3]--cycle dashed evenly;
145 drawarrow A[0]--0.96[A[0],A[1]] withpen boldpen;
146 drawarrow A[1]--0.96[A[1],A[2]] withpen boldpen;
147 for i:=0 upto 2: draw vertex(A[i]); endfor
148 label.lft(btex $h_{k-1}$ etex, A[0]);
149 label.bot(btex $h_k$ etex, A[1]);
150 label.llft(btex $\vec u$ etex, 0.5[A[0],A[1]]);
151 label.lrt(btex $\vec v$ etex, 0.5[A[1],A[2]]);
152 label.rt(btex $b$ etex, A[2]);
153 label(btex $\det(M) > 0$ etex, 0.5[A[0],A[2]]);
156 A[0] := (-1cm, -0.5cm) + shift;
157 A[1] := (0, -1cm) + shift;
158 A[2] := (1cm, -1.5cm) + shift;
159 drawarrow A[0]--0.96[A[0],A[1]] withpen boldpen;
160 drawarrow A[1]--0.96[A[1],A[2]] withpen boldpen;
161 for i:=0 upto 2: draw vertex(A[i]); endfor
162 label.lft(btex $h_{k-1}$ etex, A[0]);
163 label.llft(btex $h_k$ etex, A[1]);
164 label.llft(btex $\vec u$ etex, 0.5[A[0],A[1]]);
165 label.llft(btex $\vec v$ etex, 0.5[A[1],A[2]]);
166 label.bot(btex $b$ etex, A[2]);
167 label(btex $\det(M) = 0$ etex, origin) shifted (0,0.3cm) rotated -28 shifted 0.5[A[0], A[2]];
170 shift := (7.5cm, 1.25cm);
171 A[0] := (-1cm, -0.5cm) + shift;
172 A[1] := (1.5cm, -1cm) + shift;
173 A[2] := (2cm, -2.5cm) + shift;
174 A[3] := A[0] + A[2] - A[1];
175 fill A[0]--A[1]--A[2]--A[3]--cycle withcolor 0.8white;
176 draw A[0]--A[1]--A[2]--A[3]--cycle dashed evenly;
177 drawarrow A[0]--0.96[A[0],A[1]] withpen boldpen;
178 drawarrow A[1]--0.96[A[1],A[2]] withpen boldpen;
179 for i:=0 upto 2: draw vertex(A[i]); endfor
180 label.lft(btex $h_{k-1}$ etex, A[0]);
181 label.urt(btex $h_k$ etex, A[1]);
182 label.top(btex $\vec u$ etex, 0.5[A[0],A[1]]);
183 label.rt(btex $\vec v$ etex, 0.5[A[1],A[2]]);
184 label.rt(btex $b$ etex, A[2]);
185 label(btex $\det(M) < 0$ etex, 0.5[A[0],A[2]]);
188 figtag("rybi_motivace");
191 def draw_fish(expr pos,size,rot) =
192 draw ((-1.3u*size,0){dir 60}..{right}(u*size,-u*size/4)) rotated rot shifted pos;
193 draw ((-1.3u*size,0){dir -50}..{right}(u*size,u*size/4)) rotated rot shifted pos;
194 draw ((u*size,-u*size/4)--(u*size,u*size/4)) rotated rot shifted pos;
195 draw (-1u*size,u*size/15) rotated rot shifted pos withpen pencircle scaled (u/8);
196 for i:=1 upto 3: draw (dirs((u*size,-u*size/4+i*u*size/8), 180, u*size/6)) rotated rot shifted pos; endfor
201 A[1] := (-6.2cm, 0.9cm);
202 A[2] := (-4.6cm,1.5cm);
203 A[3] := (-2.4cm,1.8cm);
204 A[4] := (-0.8cm,1.5cm);
205 A[5] := (0.4cm,0.6cm);
206 A[6] := (0.8cm,-0.10cm);
207 A[7] := (-1.6cm,-1.9cm);
208 A[8] := (-4cm,-2.1cm);
209 A[9] := (-6cm, -1.5cm);
210 A[10] := (-7cm, 0cm);
212 B[0] := (-2.2cm, 0.7cm);
213 B[1] := (-1.2cm, 0.1cm);
214 B[2] := (-2.6cm, -0.6cm);
215 B[3] := (-3.6cm, -0.4cm);
216 B[4] := (-3cm, 0.6cm);
217 B[5] := (-2.6cm, 1cm);
218 B[6] := (-1cm, -1.2cm);
219 B[7] := (-6.5cm, 0.2cm);
220 B[8] := (-5cm, 0.8cm);
221 B[9] := (-6cm, -0.6cm);
222 B[10] := (-5cm, -1.2cm);
224 for i:=0 upto 9: draw_fish(A[i], 1, 0); endfor;
225 for i:=0 upto 10: draw_fish(B[i], 1, 0); endfor;
226 draw createpath(for i:=0 upto 9: A[i]-- endfor cycle) scaled 1.13 shifted (0.4cm,0) withpen boldpen;
229 figtag("provazkovy_algoritmus");
232 pair A[],B[],u; u := (-3cm, 0);
233 for i := 0 upto 3: A[i] := u rotated (-30*i) yscaled 0.7; endfor;
234 A[2] := A[2] + (0,0.1cm);
235 draw for i:=0 upto 2: A[i]-- endfor A[3];
236 drawarrow ((u/2) for i:=1 upto 3: ..u/2 rotated (-30*i) endfor) yscaled 0.7 withpen normalpen;
237 B[0] := (-2cm,0.5cm);
238 B[1] := (-1cm,1.5cm);
239 B[2] := (-0.5cm,0.2cm);
240 for i:=0 upto 2: draw vertex(B[i]); endfor
242 path ub; ub := (-20cm,3cm)--(20cm,3cm);
244 numeric ang[]; ang[0] = 90; ang[1] = angle(A[1]-A[0]); ang[2] = angle(A[2]-A[1]); ang[3] = angle(A[3]-A[2]);
246 draw reverse(dirs(A[i],ang[i],6cm) cutafter ub) withpen normalpen dashed evenly;
247 l := 1cm + (i-1)*0.2cm;
248 drawarrow from(A[i],ang[i],l)..from(A[i],(ang[i]+ang[i+1])/2,l)..from(A[i],ang[i+1],l) withpen normalpen;
251 for i:=0 upto 3: drawemptyvertex(A[i]); endfor;
254 figtag("naslednik_pres_konvexni_obal");
257 label.lrt(btex $Q_i$ etex, (1.5cm,-0.8cm));
262 A[i] := (2cm,0) rotated (360*i/7+5) yscaled 0.7;
265 draw for i:=0 upto 6: A[i]-- endfor cycle withpen normalpen;
266 draw C--A[2] dashed evenly;
268 draw dirs(C, -140, 0.5cm);
269 drawemptyvertex(A[2]);
271 drawdblarrow (fullcircle scaled 2cm rotated (360*2/7-5) yscaled 0.7) cutbefore (origin--(3cm,0) rotated (360*2/7+25)) withpen normalpen;
272 %drawarrow C+(0,0.5cm){dir 60}..A[2]+(0,0.5cm) withpen normalpen;
273 %drawarrow 0.6A[5]{dir 170}..(0.6A[3] rotated -15) withpen normalpen;
274 %drawarrow 0.7A[6]{dir 60}..(0.5A[1] rotated 30) withpen normalpen;