~tex-sx/tex-sx/development

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
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
\immediate\write18{tex hobby.dtx}
\documentclass{article}
\usepackage{amsmath}
\usepackage{pgfplots}
\usetikzlibrary{hobby,decorations.pathreplacing}
\input{hobby.code.tex}
\usepackage[silent]{trace-pgfkeys}

\ExplSyntaxOn
\fp_new:N \l__test_fp
\fp_set_eq:NN \l__test_fp \c_inf_fp
\fp_show:N\l__test_fp
%\fp_set:Nn \l__test_fp {20}
\fp_compare:nTF { \l__test_fp == \c_inf_fp }
{
  \message{Not~a~number}
}
{
  \message{Number}
}
\ExplSyntaxOff

\newif\ifhobbyinpath
\tikzset{
  tangent/.style={%
    called={tangent #1},
    in angle={(180+#1)},
    Hobby finish,
    Hobby action={\message{breaking path}},
    designated Hobby path=next,
    out angle=#1,
  },
  called/.code={\message{#1 got called}},
  every path/.append style={clear next Hobby path options,clear this Hobby path options},
  show curve controls/.style={
    decoration={
      show path construction,
      curveto code={
        \draw [blue, dashed]
        (\tikzinputsegmentfirst)    -- (\tikzinputsegmentsupporta)
        node [at end, draw, solid, red, inner sep=2pt]{};
        \draw [blue, dashed]
        (\tikzinputsegmentsupportb) -- (\tikzinputsegmentlast)
        node [at start, draw, solid, red, inner sep=2pt]{};
      }
    },decorate
  },
  Hobby externalise
}

\pgfmathparse{atan2(0,1)}
\show\pgfmathresult
\pgfmathparse{hobbyatan2(0,1)}
\show\pgfmathresult

\HobbyDisableAux

\begin{document}

\begin{tikzpicture}[use Hobby shortcut]
%\draw[ultra thick,red] (-0.6,-1) .. (0,-0.9) .. (2,0.6);
\node (star) at (-0.6,-1) {};
\draw (star.center) .. (0,-0.9) .. (2,0.6);
\draw (0,0) -- (star) -- (2,0);
\end{tikzpicture}
\end{document}

\begin{tikzpicture}[use Hobby shortcut]
% filled points
\fill (0,0) circle (1pt);
\fill (2,0) circle (1pt);
% middle crossing loop
\draw[save Hobby path=fish,thick, red] (3,-1) .. ([blank=soft]2,0) .. (0,0.93) .. (-0.93,0) .. (0,-0.93) .. (2,0) .. ([blank=soft]3,1);
\tikzset{show Hobby path=fish}
\draw[restore and use Hobby path={fish}{invert soft blanks,disjoint=true},thick, blue];
\end{tikzpicture}

\begin{tikzpicture}
\pgfpathmoveto{\pgfpoint{0}{0}}
\pgfpathlineto{\pgfpoint{1cm}{0}}
\pgfpathhobby{closed=true}
\pgfpathhobbypt{\pgfpoint{1cm}{2cm}}{tension in=2}
\pgfpathhobbypt{\pgfpoint{2cm}{1cm}}
\pgfpathhobbypt{\pgfpoint{3cm}{0cm}}
\pgfpathhobbyend
\pgfusepath{stroke}
\end{tikzpicture}

\begin{tikzpicture}[use Hobby shortcut]
\draw (0,0) -- (1,0) .. (1,2) .. (2,1) .. (3,0);
\end{tikzpicture}


\begin{tikzpicture}[scale=.5]
\draw[red,line width=5pt] (0,0) to[curve through={(6,4) .. (4,9) .. (1,7)}] (3,5);
\draw[ultra thick,blue] plot[smooth] coordinates {(0,0) (6,4) (4,9) (1,7) (3,5)};
\draw[green,line width=2pt] (0,0) to[quick curve through={(6,4) (4,9)  (1,7)}] (3,5);
\end{tikzpicture}

\begin{tikzpicture}%[use quick Hobby shortcut]
\draw[use Hobby shortcut] (0,0) .. (1,1) .. (2,0);
\draw[use quick Hobby shortcut] (0,0) .. (1,1) .. (2,0);
\end{tikzpicture}

\begin{tikzpicture}
\begin{axis}
\addplot +[smooth] {rnd};
\addplot +[hobby] {rnd};
\end{axis}
\end{tikzpicture}


\begin{tikzpicture}[use Hobby shortcut]
\draw[save Hobby path=temp] (0,0) .. (1,1) .. (2,0);
\tikzset{show Hobby path=temp}
\end{tikzpicture}

\begin{tikzpicture}
\draw (0,0) .. controls (0,.5) and (.5,1) .. (1,1) .. controls (1.5,1) and (2,.5) .. (2,0);
\end{tikzpicture}

\begin{tikzpicture}
\draw (0,0) to[curve through={(1,1)}] (2,0);
\end{tikzpicture}

\begin{tikzpicture}[use Hobby shortcut,baseline=0pt]
\filldraw[fill=yellow] ([closed]1,0.1) .. (.4,.6) .. (0.1,1) .. (-.5,.5) .. (-1,-0.1) .. (-.4,-.6) .. (-.1,-1) .. (.6,-.4) .. (1,0.1);
\draw[->] (0,0) -- (0,.5);
\draw[->] (0,0) -- (.5,0);
\fill (0,0) circle[radius=2pt] node[below] {\(p\)};
\end{tikzpicture}

%\pgfmathsetseed{2}
\begin{tikzpicture}
\draw[use Hobby shortcut] ([closed]0,0) .. (1,1) .. (2,0);
\end{tikzpicture}

\begin{tikzpicture}
\draw[use Hobby shortcut] (0:rnd+2) \foreach \ang in {0,20,...,350} { .. (\ang:rnd+2) };
\end{tikzpicture}

\begin{tikzpicture}
\draw[use Hobby shortcut] ([closed]0:rnd+2) \foreach \ang in {0,20,...,350} { .. (\ang:rnd+2) };
\end{tikzpicture}

\begin{tikzpicture}[use Hobby shortcut]
\draw[save Hobby path={first}]
(1,0) .. coordinate (a) ([blank=soft]2,1) .. coordinate (b) ([blank=soft]3,0) .. (4,1) .. coordinate (e) (5,0);
\draw[ultra thick,blue,restore and use Hobby path={first}{disjoint,invert soft blanks}];
\draw[red,<-] (a) -- +(0,3) node[above] {a};
\draw[green,<-] (b) -- +(0,3) node[above] {b};
\draw[blue,<-] (e) -- +(0,3) node[above] {e};
\begin{scope}[xshift=4cm]
\draw (1,0) -- coordinate (c) (2,1) -- coordinate (d) (3,0);
\draw[red,<-] (c) -- +(0,3) node[above] {c};
\draw[green,<-] (d) -- +(0,3) node[above] {d};
\end{scope}
\end{tikzpicture}


\begin{tikzpicture}
\draw[use Hobby shortcut] ([closed]0:rnd+2) \foreach \ang in {0,20,...,350} { .. (\ang:rnd+2) };
\end{tikzpicture}


\begin{tikzpicture}
\draw[line width=3mm,red,use Hobby shortcut,save Hobby path={saved}] (0,0) .. ([blank=soft]1,1) .. (2,0);
\draw[ultra thick,yellow,restore and use Hobby path={saved}{disjoint,invert soft blanks}];
\end{tikzpicture}

\begin{tikzpicture}[use Hobby shortcut]
\draw[ultra thick,green,postaction=show curve controls]
(0,0) to[save Hobby path={curve},in curl=.1,out curl=3,curve through={(1,.5) .. (2,0) .. (3,.5)}] (4,0);
\begin{scope}%[yshift=-1cm]
\draw[postaction=show curve controls]
(0,0) .. ([in curl=.1,out curl=3]1,.5) .. (2,0) .. (3,.5) .. (4,0);
\end{scope}
\end{tikzpicture}

\tikz[hobby] \draw[save Hobby path={plot}] plot coordinates {(0,0) (1,1) (2,0) (3,1) (2,1) (10:2cm)};


\begin{tikzpicture}[use Hobby shortcut]
\draw[scale=-2,inner color=white,outer color=gray!5] ([closed]0.5,0.1) .. (0.7,0.28) .. (0.5,1) .. (0.3,0.28) .. (0.5,0.1);
\end{tikzpicture}

\newpage

\begin{tikzpicture}[use Hobby shortcut]
\draw[help lines] (-5,-5) grid (5,5);
\draw (-5,0) -- (5,0) (0,-5) -- (0,5);
\draw[thick] ([tangent=150]-5,2) .. ([tangent=0]-3,3) .. (-1,1) .. (0,-1.3) .. ([tangent=0]1,-2) .. ([tangent=45]2,-1.5) .. ([tangent=0]3,-2) .. ([tangent=-45]5,-4);
\end{tikzpicture}

\begin{tikzpicture}[use Hobby shortcut]
\draw[help lines] (-5,-5) grid (5,5);
\draw (-5,0) -- (5,0) (0,-5) -- (0,5);
\draw[thick] (-5,2) .. ([tangent=0]-3,3) .. (-1,1) .. (0,-1.3) .. %
([tangent=0]1,-2) .. ([tangent=45]2,-1.5) .. ([tangent=0]3,-2) .. (5,-4);
\end{tikzpicture}

\begin{tikzpicture}[use Hobby shortcut]
\draw[help lines] (-5,-5) grid (5,5);
\draw (-5,0) -- (5,0) (0,-5) -- (0,5);
\draw[thick] (-5,2) .. (-3,3) .. (-1,1) .. (0,-1.3) .. %
([tangent=0]1,-2) .. ([tangent=45]2,-1.5) .. (3,-2) .. (5,-4);
\end{tikzpicture}

\newpage

\begin{tikzpicture}
\draw[use Hobby shortcut] (0,0) .. ([tangent=45]1,1) .. (2,0) .. (3,1) .. (4,0);
\end{tikzpicture}

\begin{tikzpicture}[use Hobby shortcut]
\draw[blue,save Hobby path={left}] ([out angle=90,in angle=-90]1,0) .. (1,1) .. ([blank=soft]0,2) .. (1,3) .. (1,4);
\draw[show Hobby path={left},red] ([out angle=90,in angle=-90]0,0) .. (0,1) .. (1,2) .. (0,3) .. (0,4);
\tikzset{show Hobby path={left}}
\draw[blue,show Hobby path={left},restore and use Hobby path={left}{disjoint,invert soft blanks}];
\end{tikzpicture}

\begin{tikzpicture}[use Hobby shortcut]
\draw[blue,save Hobby path={upper}] ([out angle=0,in angle=-180]0,1) .. (1,1) .. ([blank=soft]2,0) .. (3,1) .. (4,1);
\draw[show Hobby path={upper},red] ([out angle=0,in angle=-180]0,0) .. (1,0) .. (2,1) .. (3,0) .. (4,0);
\tikzset{show Hobby path={upper}}
\draw[blue,show Hobby path={upper},restore and use Hobby path={upper}{disjoint,invert soft blanks}];
\end{tikzpicture}

\begin{tikzpicture}[use Hobby shortcut]
\draw ([out angle=0]0,0) .. (0,2);
\draw ([out angle=0]0,0) .. (2,0);
\begin{scope}[xshift=3cm]
\draw ([out angle=90]0,0) .. (0,2);
\draw ([out angle=90]0,0) .. (2,0);
\begin{scope}[xshift=3cm]
\draw ([out angle=180]0,0) .. (0,2);
%\draw ([out angle=180]0,0) .. (2,0);
\end{scope}
\end{scope}
\end{tikzpicture}


\newpage
\begin{tikzpicture}
\begin{axis}
%\addplot +[smooth] {rnd};
%\addplot +[hobby] {rnd};
\end{axis}
\end{tikzpicture}

\newpage



%\tikzset{use quick Hobby shortcut}

\begin{tikzpicture}
\draw[use Hobby shortcut] (0,0) .. (1,1) .. (2,1);
\end{tikzpicture}

\newpage

\tikz[smooth] \draw plot coordinates {(0,0) (1,1) (2,0) (3,1) (2,1) (10:2cm)};

\tikz[hobby] \draw plot coordinates {(0,0) (1,1) (2,0) (3,1) (2,1) (10:2cm)};

\tikz[closed hobby] \draw plot coordinates {(0,0) (1,1) (2,0) (3,1) (2,1) (10:2cm)};

\tikz[quick hobby] \draw plot coordinates {(0,0) (1,1) (2,0) (3,1) (2,1) (10:2cm)};

\newpage

\begin{tikzpicture}[use Hobby shortcut]
\draw ([out angle=10]0,0) .. ([in angle=90]1,1);
\end{tikzpicture}

\begin{tikzpicture}[use Hobby shortcut]
\draw ([out angle=10]0,0) .. ([in angle=90]1,1);
\end{tikzpicture}

\begin{tikzpicture}[use Hobby shortcut]
\draw[scale=-2,inner color=white,outer color=gray!5] ([closed]0.5,0.1) .. (0.7,0.28) .. (0.5,1) .. (0.3,0.28) .. (0.5,0.1);
\end{tikzpicture}


\begin{tikzpicture}[use Hobby shortcut]
\draw (0,0) .. (1,1) .. (2,0);
\draw (0,0) \foreach \k in {1} { .. (\k^2, \k)};
\end{tikzpicture}

\tikz[hobby] \draw plot coordinates {(0,0) ([blank=true]1,1) (2,0) (3,1) (2,1) (10:2cm)};

\tikz[use Hobby shortcut] \draw (0,0) .. (1,1) .. ([blank=true]2,0) .. (3,1) .. ([blank=true]2,1) .. (10:2cm);

\tikz \draw (0,0) to[quick curve through={(1,1) (2,0) ([quick hobby/blank curve=once]3,1) (2,1)}] (10:2cm);

\tikz \draw plot coordinates {(0,0) (1,1) (2,0) (3,1) (2,1) (10:2cm)};

\tikz[smooth] \draw plot coordinates {(0,0) (1,1) (2,0) (3,1) (2,1) (10:2cm)};

\tikz[hobby] \draw (1,0) -- plot coordinates {(0,0) (1,1) (2,0) (3,1) (2,1) (10:2cm)};

\tikz[closed hobby] \draw plot coordinates {(0,0) (1,1) (2,0) (3,1) (2,1) (10:2cm)};

\tikz[quick hobby] \draw plot coordinates {(0,0) (1,1) (2,0) (3,1) (2,1) (10:2cm)};

\begin{tikzpicture}[scale=.5]
\draw[scale=.1,line width=1mm,red] (0,0)
.. controls (26.76463,-1.84543) and (51.4094,14.58441) .. (60,40)
.. controls (67.09875,61.00188) and (59.76253,84.57518) .. (40,90)
.. controls (25.35715,94.01947) and (10.48064,84.5022) .. (10,70)
.. controls (9.62895,58.80421) and (18.80421,49.62895) .. (30,50);
\fill[green] (0,0) circle[radius=2pt]
(6,4) circle[radius=2pt]
(4,9) circle[radius=2pt]
(1,7) circle[radius=2pt]
(3,5) circle[radius=2pt];
\draw[thick] (0,0) to[curve through={(6,4) .. (4,9) .. (1,7)}] (3,5);
\begin{scope}[xshift=10cm]
\draw[scale=.1,line width=1mm,red] (0,0)
.. controls (5.18756,-26.8353) and (60.36073,-18.40036) .. (60,40)
.. controls (59.87714,59.889) and (57.33896,81.64203) .. (40,90)
.. controls (22.39987,98.48387) and (4.72404,84.46368) .. (10,70)
.. controls (13.38637,60.7165) and (26.35591,59.1351) .. (30,50)
.. controls (39.19409,26.95198) and (-4.10555,21.23804) .. (0,0); % 
\fill[green] (0,0) circle[radius=2pt]
(6,4) circle[radius=2pt]
(4,9) circle[radius=2pt]
(1,7) circle[radius=2pt]
(3,5) circle[radius=2pt];
\draw[thick] (0,0) to[closed,curve through={(6,4) .. (4,9) .. (1,7)}] (3,5);
\end{scope}
\end{tikzpicture}


\begin{tikzpicture}
\draw[red,line width=5pt] (0,0) to[curve through={(6,4) .. (4,9) .. (1,7)}] (3,5);
\draw[ultra thick,blue] plot[smooth] coordinates {(0,0) (6,4) (4,9) (1,7) (3,5)};
\draw[green,line width=2pt] (0,0) to[quick curve through={(6,4) (4,9)  (1,7)}] (3,5);
\end{tikzpicture}

\begin{tikzpicture}[use Hobby shortcut]
\draw[ultra thick,blue] (0,0) .. (1,1) .. (2,0) .. (3,0) .. (2,2) .. (2,4);
\draw[red] (0,0) to[quick curve through={(1,1) (2,0) (3,0) (2,2)}] (2,4);
\end{tikzpicture}

\section{A Piecewise Version of Hobby's Algorithm}

Here we present a variant of Hobby's algorithm.
One difficulty with Hobby's algorithm is that it works with the path as a whole.
It is therefore not possible to build up a path piecewise.
We therefore modify it to correct for this.
Obviously, the resulting path will be less ``ideal'', but will have the property that adding new points will not affect earlier segments.

The method we use is to employ Hobby's algorithm on the two-{}segment subpaths.
This provides two cubic Bezier curves: one from the \(k\)th point to the \(k+1\)st point and the second from the \(k+1\)st to the \(k+2\)nd.
Of this data, we keep the first segment and use that for the path between the \(k\)th and \(k+1\)st points.
We also remember the outgoing angle of the first segment and use that as the incoming angle on the next computation (which will involve the \(k+1\)st, \(k+2\)nd, and \(k+3\)rd) points.

The two ends are slightly different to the middle segments.
On the first segment, we might have no incoming angle.
On the last segment, we render both pieces.

This means that for the initial segment, we have a \(2 \times 2\) linear system:
%
\[
  \begin{bmatrix}
  B_0 & C_0 \\
  A_1 & B_1
  \end{bmatrix}
  \Theta = \begin{bmatrix}
  D_0 \\ D_1
  \end{bmatrix}
\]
%
This has solution:
%
\[
  \Theta = \frac{1}{B_0 B_1 - C_0 A_1} \begin{bmatrix} B_1 & - C_0 \\ -A_1 & B_0 \end{bmatrix} \begin{bmatrix} D_0 \\ D_1 \end{bmatrix} =  \frac{1}{B_0 B_1 - C_0 A_1} \begin{bmatrix} B_1 D_0 - C_0 D_1 \\ B_0 D_1 - A_1 D_0 \end{bmatrix}
\]

Now we have the following values for the constants:
%
\begin{align*}
A_1 &= d_1 \overline{\tau}_2 \overline{\tau}_1^2 \\
%
B_0 &= \tau_0^3 (3 \overline{\tau}_1 - 1) + \chi_0 \overline{\tau}_1^3 \\
%
B_1 &= d_1 \overline{\tau}_2 \overline{\tau}_1^2 (3 \tau_0 - 1) + d_0 \tau_0 \tau_1^2(3 \overline{\tau}_2 - 1) - d_0 \tau_0 \tau_1^2 \frac{\overline{\tau}_2^3 + \chi_2 \tau_1^3 (3 \overline{\tau}_2 - 1)}{\overline{\tau}_2^3 (3 \tau_1 - 1) + \chi_2 \tau_1^3} \\
%
C_0 &= \tau_0^3 + \chi_0 \overline{\tau}_1^3 (3 \tau_0 - 1) \\
%
D_0 &= - (\tau_0^3 + \chi_0 \overline{\tau}_1^3 ( 3 \tau_0 - 1)) \psi_1 \\
%
D_1 &= - d_1 \overline{\tau}_2 \overline{\tau}_1^2 (3 \tau_0 - 1) \psi_1
\end{align*}
%

Let us, for simplicity at the start, assume that the tensions and curls are all \(1\).
Then we have \(A_1 = d_1\), \(B_0 = 3\), \(B_1 = 2 d_1 + 2 d_0 - d_0 = 2 d_1 + d_0\), \(C_0 = 3\), \(D_0 = - 3 \psi_1\), \(D_1 = - 2 d_1 \psi_1\).
Thus the linear system is:
%
\[
  \begin{bmatrix}
  3 & 3 \\
  d_1 & 2 d_1 + d_0
  \end{bmatrix}
  \Theta = - \psi_1 \begin{bmatrix}
  3 \\ 2 d_1
  \end{bmatrix}
\]
%
which we can row reduce to:
%
\[
  \begin{bmatrix}
  1 & 1 \\
  0 & d_1 + d_0 
  \end{bmatrix}
  \Theta = -\psi_1 \begin{bmatrix}
  1 \\ d_1
  \end{bmatrix}
\]
%
whence \(\theta_1 = -\psi_1 \frac{d_1}{d_0 + d_1}\) and \(\theta_0 = -\psi_1 - \theta_1 = -\psi_1\frac{d_0 }{d_0 + d_1}\).
We also compute \(\phi_1 = -\psi_1 - \theta_1 = \theta_0\) and \(\phi_2 = \theta_1\) (in the simple version).
We use \(\theta_0\) and \(\phi_1\) to compute the bezier curve of the first segment, make a note of \(\theta_1\), and -- assuming there are more segments -- throw away \(\phi_2\).

For the inner segments, we have the system:
%
\[
  \begin{bmatrix}
  1 & 0 \\
  A_1 & B_1
  \end{bmatrix}
  \Theta = \begin{bmatrix}
  \theta_0 \\
  D_1
  \end{bmatrix}
\]
%
which has the solution \(\theta_1 = (D_1 - A_1 \theta_0)/B_1\).
The values of the constants in this case are:
%
\begin{align*}
A_1 &= d_1 \overline{\tau}_2 \overline{\tau}_1^2 \\
%
B_1 &= d_1 \overline{\tau}_2 \overline{\tau}_1^2 (3 \tau_0 - 1) + d_0 \tau_0 \tau_1^2(3 \overline{\tau}_2 - 1) - d_0 \tau_0 \tau_1^2 \frac{\overline{\tau}_2^3 + \chi_2 \tau_1^3 (3 \overline{\tau}_2 - 1)}{\overline{\tau}_2^3 (3 \tau_1 - 1) + \chi_2 \tau_1^3} \\
%
D_1 &= - d_1 \overline{\tau}_2 \overline{\tau}_1^2 (3 \tau_0 - 1) \psi_1
\end{align*}

Again, let us consider the simpler case.
Then \(A_1 = d_1\), \(B_1 = 2 d_1 + d_0\), and \(D_1 = - 2 d_1 \psi_1\).
Thus \(\theta_1 = (-2 d_1 \psi_1 - d_1 \theta_0)/(2 d_1 + d_0) = - (2 \psi_1 + \theta_0) \frac{d_1}{2 d_1 + d_0}\).
We compute \(\phi_1 = -\psi_1 - \theta_1 = \frac{- \psi_1 d_0 + \theta_0 d_1}{2 d_1 + d_0}\) and \(\phi_2 = \theta_1\).

\begin{tikzpicture}
\draw[red,line width=5pt] (0,0) to[curve through={(6,4) .. (4,9) .. (1,7)}] (3,5);
\draw[ultra thick,blue] plot[smooth] coordinates {(0,0) (6,4) (4,9) (1,7) (3,5)};
\draw[green,line width=2pt] (0,0) to[quick curve through={(6,4) (4,9)  (1,7)}] (3,5);
\end{tikzpicture}


\begin{tikzpicture}[use Hobby shortcut, c/.style={insert path={circle[radius=2pt]}}]
\fill[green] (0,0) [c] (1,.5) [c] (0,0) [c] (3,.5) [c] (4,0) [c];
\draw (0,0) .. (1,.5) .. (-0.2,0) .. (3,.5) .. (4,0);
\end{tikzpicture}

\begin{tikzpicture}
\draw (0.0000, 0.0000) .. controls (-1.85420, 0.83131) and (1.44747, 2.48215)..(1.0000, 0.5000) .. controls (0.90917, 0.09765) and (0.31923, 0.27721)..(0.1000, 0.0000) .. controls (-1.10155, -1.51937) and (1.46789, -0.02595)..(3.0000, 0.5000) .. controls (3.41450, 0.64229) and (3.86513, 0.41698)..(4.0000, 0.0000);
\end{tikzpicture}

\begin{tikzpicture}
\draw (0.0000, 0.0000) .. controls (0.30056, -0.75821) and (1.42623, -0.19537)..(1.0000, 0.5000) .. controls (0.69595, 0.99605) and (-0.14029, 0.67496)..(0.0000, 0.0000) .. controls (0.31344, -1.50803) and (1.85232, 0.35331)..(3.0000, 0.5000) .. controls (3.40390, 0.55162) and (3.79896, 0.35409)..(4.0000, 0.0000);
\end{tikzpicture}

\begin{tikzpicture}
\draw (0,0) to[curve through={(6,4) .. (4,9) .. (1,7)}] (3,5);
\end{tikzpicture}

\begin{tikzpicture}
\draw (0,0) to[closed,curve through={(6,4) .. (4,9) .. (1,7)}] (3,5);
\end{tikzpicture}
\end{document}


% Local Variables:
% tex-output-type: "pdf18"
% End: