summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/generic/pst-vehicle/pst-vehicle-doc.tex
blob: f8acf1e1f594a7276d0d678e7075f9158bb927b0 (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
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
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
%%
%% This is file `pst-vehicle-doc.tex',
%%
%% IMPORTANT NOTICE:
%%
%% Package `pst-vehicle.tex'
%%
%% Thomas S\"{o}ll
%% with the collaboration of
%% Juergen Gilg
%% Manuel Luque
%%
%% This program can redistributed and/or modified under %%
%% the terms of the LaTeX Project Public License        %%
%% Distributed from CTAN archives in directory          %%
%% macros/latex/base/lppl.txt; either version 1.3c of   %%
%% the License, or (at your option) any later version.  %%
%%
%% DESCRIPTION:
%%   `pst-vehicle' is a PSTricks package
%%
%%
\documentclass[11pt,english,BCOR10mm,DIV12,bibliography=totoc,parskip=false,fleqn,
   smallheadings, headexclude,footexclude,oneside,dvipsnames,svgnames,x11names,distiller]{pst-doc}
%\documentclass[11pt,english,BCOR10mm,DIV12,bibliography=totoc,parskip=false,smallheadings
%    headexclude,footexclude,oneside,dvipsnames,svgnames,distiller]{pst-doc}
\listfiles
\usepackage[autostyle]{csquotes}
\usepackage{biblatex}%\usepackage[style=dtk]{biblatex}
\addbibresource{pst-vehicle-doc.bib}
\usepackage[utf8]{inputenc}
\let\pstpersFV\fileversion
\usepackage[e]{esvect} % f\"{u}r sch\"{o}nere Vektorpfeile
\usepackage{pst-vehicle,pst-eucl,pstricks-add,animate}
\let\belowcaptionskip\abovecaptionskip

\def\bgImage{%
\begin{pspicture}(0,0)(14,8)
\def\FuncA{0.5*cos(1.5*x)+0.25*x}
\psplot[plotpoints=500]{0}{16}{\FuncA}
\psVehicle[vehicle=\HighWheeler,showSlope=false,linecolor=Gold]{0.35}{1.2}{\FuncA}%
\psVehicle[vehicle=\Bike,style=bike,showSlope=false,linecolor=green!70]{0.5}{6}{\FuncA}%
\psVehicle[vehicle=\Truck,style=truck,showSlope=false]{0.35}{12.2}{\FuncA}%
\end{pspicture}
}

\lstset{language=PSTricks,morekeywords={psVehicle}\footnotesize\ttfamily}
%
\psset{labelFontSize=\scriptstyle}% for mathmode
\psset{algebraic=true}
\newpsstyle{quadrillage}{subgriddiv=2,gridlabels=5pt,gridwidth=0.3pt,gridcolor=black!50,subgridwidth=0.2pt,subgridcolor=black}

\newcommand{\Epkt}[3]{\ensuremath{{\text{#1}}\left(\,#2\;\vline\;#3\,\right)}}



\begin{document}

\title{pst-vehicle v 1.0}
\subtitle{A PSTricks package for slipping/rolling vehicles on curves of any kind of mathematical functions}
\author{Thomas \textsc{S\"{o}ll}\\
avec la collaboration de\\
Manuel \textsc{Luque} et J\"{u}rgen \textsc{Gilg}}
\date{\today}

\maketitle

\tableofcontents
\psset{unit=1cm}


\clearpage


\begin{abstract}
This package was created to illustrate the notion of slope, the coefficient of the tangent line at a point of a curve. On the road, a rampant way or a dangerous descent due to their slope is indicated by a sign showing the percentage of the slope of this section of road, for example 10\,\%. It was therefore quite obvious that the idea of representing a vehicle rolling without slipping on a curve came into our minds. Different types of vehicles are proposed, the shape of the curve is to be defined by its equation: $y=f(x)$ in algebraic notation.
The line connecting the two contact points from the front and the rear wheel with the curve and the sign of the slope can be easily displayed. It is also possible to represent, not a speed-o-meter of the vehicle, but a slope-o-meter was introduced as an indicator of the value of the slope of the straight line defined above.


\vfill
This program can redistributed and/or modified under %%
the terms of the LaTeX Project Public License        %%
Distributed from CTAN archives in directory          %%
macros/latex/base/lppl.txt; either version 1.3c of   %%
the License, or (at your option) any later version.  %%

\end{abstract}


\clearpage



\section{Theory---the mathematical background}

Within the following first sections, we like to show the theory on how we programmed the package. Easy elementary vector geometry with some basic calculus aspects.



\subsection{Wheels on a curve---equal radii}

\psset{saveNodeCoors,NodeCoorPrefix=n,algebraic}
\def\myFunk{2-0.25*x^2}
\def\abl{Derive(1,\myFunk)}
\begin{pspicture}(-10,-1)(8,3.5)
\psplot{-3.8}{3.8}{\myFunk}
\pnode(*-3 {\myFunk}){A}
\pnode(*nAx {\abl}){A_St}
\pnode(*-1 {\myFunk}){B}
\pnode(*nBx {\abl}){B_St}
\psdot(A)
\psdot(B)
\uput*[-90](A){\small$\Epkt{}{x_0}{f(x_0)}$}
\uput*[-90](B){\small$\Epkt{}{x}{f(x)}$}

\pnode(!nAx nA_Sty 1 nA_Sty dup mul add sqrt div sub nAy 1 1 nA_Sty dup mul add sqrt div add){H}
\pnode(!nBx nB_Sty 1 nB_Sty dup mul add sqrt div sub nBy 1 1 nB_Sty dup mul add sqrt div add){V}
\psdot[linecolor=red](H)
\psdot[linecolor=red](V)
\pscircle[dimen=outer,linecolor=gray](H){1}
\pscircle[dimen=outer,linecolor=gray](V){1}

\pcline[linecolor=red](H)(V)\naput*{$R$}
\pcline[linecolor=blue](H)(A)\naput{$r$}
\pcline[linecolor=blue](V)(B)\naput{$r$}

\psplotTangent[linestyle=dashed,linecolor=Green]{nAx}{1.5}{\myFunk}
\psplotTangent[linestyle=dashed,linecolor=Green]{nBx}{1.5}{\myFunk}
\end{pspicture}

The boundary point of the back wheel (radius $r$ from the back wheel axis) with the curve:
\begin{equation*}
\vec{x}_0=
\begin{pmatrix}
x_0\\
f(x_0)
\end{pmatrix}
\end{equation*}
The direction of the tangent line is:
\begin{equation*}
\vec{t}_0=
\begin{pmatrix}
1\\
f'(x_0)
\end{pmatrix}
\end{equation*}
The normed normal vector in $x_0$ is:
\begin{equation*}
\vec{n}_{0x_0}=\frac{1}{\sqrt{1+f'(x_0)^2}}
\begin{pmatrix}
-f'(x_0)\\
1
\end{pmatrix}
\end{equation*}
The point $H$ -- coordinates of the back wheel axis is:
\begin{align*}
\overrightarrow{BW}&=\vec{x}_0+r\cdot \vec{n}_{0x_0}\\
&=\begin{pmatrix}
x_0-r\frac{f'(x_0)}{\sqrt{1+f'(x_0)^2}}\\
f(x_0)+r\frac{1}{\sqrt{1+f'(x_0)^2}}
\end{pmatrix}
\end{align*}
$x$ is the abscissa of the boundary point of the front wheel with the curve.

The normed normal vector in $x$ is:
\begin{equation*}
\vec{n}_{0x}=\frac{1}{\sqrt{1+f'(x)^2}}
\begin{pmatrix}
-f'(x)\\
1
\end{pmatrix}
\end{equation*}
The point $V$ -- coordinates of the front wheel axis is:
\begin{align*}
\overrightarrow{FW}&=\vec{x}+r\cdot \vec{n}_{0x}\\
&=\begin{pmatrix}
x-r\frac{f'(x)}{\sqrt{1+f'(x)^2}}\\
f(x)+r\frac{1}{\sqrt{1+f'(x)^2}}
\end{pmatrix}
\end{align*}
The distance between the axes is $R$ -- thus:
\begin{align*}
|\overrightarrow{FW}-\overrightarrow{BW}|&=R\\
\left|
\begin{pmatrix}
x-r\frac{f'(x)}{\sqrt{1+f'(x)^2}}-\left(x_0-r\frac{f'(x_0)}{\sqrt{1+f'(x_0)^2}}\right)\\
f(x)+r\frac{1}{\sqrt{1+f'(x)^2}}-\left(f(x_0)+r\frac{1}{\sqrt{1+f'(x_0)^2}}\right)
\end{pmatrix}
\right|&=R\\
\left|\begin{pmatrix}
x-x_0+r\left(\frac{f'(x_0)}{\sqrt{1+f'(x_0)^2}}-\frac{f'(x)}{\sqrt{1+f'(x)^2}}\right)\\
f(x)-f(x_0)+r\left(\frac{1}{\sqrt{1+f'(x)^2}}-\frac{1}{\sqrt{1+f'(x_0)^2}}\right)
\end{pmatrix}
\right|&=R
\end{align*}
This leads to an equation of the variable $x$, where $x$ is the abscissa of the boundary point of the front wheel with the curve.
\begin{equation*}
\left(x-x_0+r\left(\frac{f'(x_0)}{\sqrt{1+f'(x_0)^2}}-\frac{f'(x)}{\sqrt{1+f'(x)^2}}\right)\right)^2+\left(f(x)-f(x_0)+r\left(\frac{1}{%
\sqrt{1+f'(x)^2}}-\frac{1}{\sqrt{1+f'(x_0)^2}}\right)\right)^2=R^2
\end{equation*}



\subsection{Wheels on a curve---different radii}

\psset{saveNodeCoors,NodeCoorPrefix=n,algebraic}
\def\myFunk{2-0.25*x^2}
\def\abl{Derive(1,\myFunk)}
\begin{pspicture}(-10,-2)(8,3)
\psplot{-4}{4}{\myFunk}
\pnode(*-3 {\myFunk}){A}
\pnode(*nAx {\abl}){A_St}
\pnode(*-1 {\myFunk}){B}
\pnode(*nBx {\abl}){B_St}
\psdot(A)
\psdot(B)
\uput*[-90](A){\small$\Epkt{}{x_0}{f(x_0)}$}
\uput*[-90](B){\small$\Epkt{}{x}{f(x)}$}

\pnode(!nAx nA_Sty 1 nA_Sty dup mul add sqrt div sub nAy 1 1 nA_Sty dup mul add sqrt div add){H}
\pnode(!nBx nB_Sty 1 nB_Sty dup mul add sqrt div 0.7 mul sub nBy 1 1 nB_Sty dup mul add sqrt div 0.7 mul add){V}
\psdot[linecolor=red](H)
\psdot[linecolor=red](V)
\pscircle[dimen=outer,linecolor=gray](H){1}
\pscircle[dimen=outer,linecolor=gray](V){0.7}

\pcline[linecolor=red](H)(V)\naput*{$R$}
\pcline[linecolor=blue](H)(A)\naput{$r_1$}
\pcline[linecolor=blue](V)(B)\naput{$r_2$}

\psplotTangent[linestyle=dashed,linecolor=Green]{nAx}{1.5}{\myFunk}
\psplotTangent[linestyle=dashed,linecolor=Green]{nBx}{1.5}{\myFunk}
\end{pspicture}

The boundary point of the back wheel (radius $r_1$ from the back wheel axis) with the curve:
\begin{equation*}
\vec{x}_0=
\begin{pmatrix}
x_0\\
f(x_0)
\end{pmatrix}
\end{equation*}
The direction of the tangent line is:
\begin{equation*}
\vec{t}_0=
\begin{pmatrix}
1\\
f'(x_0)
\end{pmatrix}
\end{equation*}
The normed normal vector in $x_0$ is:
\begin{equation*}
\vec{n}_{0x_0}=\frac{1}{\sqrt{1+f'(x_0)^2}}
\begin{pmatrix}
-f'(x_0)\\
1
\end{pmatrix}
\end{equation*}
The point $H$ -- coordinates of the back wheel axis is:
\begin{align*}
\overrightarrow{BW}&=\vec{x}_0+r_1\cdot \vec{n}_{0x_0}\\
&=\begin{pmatrix}
x_0-r_1\frac{f'(x_0)}{\sqrt{1+f'(x_0)^2}}\\
f(x_0)+r_1\frac{1}{\sqrt{1+f'(x_0)^2}}
\end{pmatrix}
\end{align*}
$x$ is the abscissa of the boundary point of the front wheel with the curve.

The normed normal vector in $x$ is:
\begin{equation*}
\vec{n}_{0x}=\frac{1}{\sqrt{1+f'(x)^2}}
\begin{pmatrix}
-f'(x)\\
1
\end{pmatrix}
\end{equation*}
The point $V$ -- coordinates of the front wheel axis is:
\begin{align*}
\overrightarrow{FW}&=\vec{x}+r_2\cdot \vec{n}_{0x}\\
&=\begin{pmatrix}
x-r_2\frac{f'(x)}{\sqrt{1+f'(x)^2}}\\
f(x)+r_2\frac{1}{\sqrt{1+f'(x)^2}}
\end{pmatrix}
\end{align*}
The distance between the axes is $R$ -- thus:
\begin{align*}
|\overrightarrow{FW}-\overrightarrow{BW}|&=R\\
\left|
\begin{pmatrix}
x-r_2\frac{f'(x)}{\sqrt{1+f'(x)^2}}-\left(x_0-r_1\frac{f'(x_0)}{\sqrt{1+f'(x_0)^2}}\right)\\
f(x)+r_2\frac{1}{\sqrt{1+f'(x)^2}}-\left(f(x_0)+r_2\frac{1}{\sqrt{1+f'(x_0)^2}}\right)
\end{pmatrix}
\right|&=R\\
\end{align*}
This leads to an equation of the variable $x$, where $x$ is the abscissa of the boundary point of the front wheel with the curve.
\begin{equation*}
\left(x-x_0+r_1\frac{f'(x_0)}{\sqrt{1+f'(x_0)^2}}-r_2\frac{f'(x)}{\sqrt{1+f'(x)^2}}\right)^2+
\left(f(x)-f(x_0)+r_2\frac{1}{\sqrt{1+f'(x)^2}}-r_1\frac{1}{\sqrt{1+f'(x_0)^2}}\right)^2=R^2
\end{equation*}



\subsection{Inclination angle between back wheel and front wheel axes}

\psset{saveNodeCoors,NodeCoorPrefix=n,algebraic}
\def\myFunk{0}
\def\abl{Derive(1,\myFunk)}
\begin{pspicture}(-10,-0.5)(8,4)
\psplot{-8}{4}{\myFunk}
\pnode(*-5 {\myFunk}){A}
\pnode(*nAx {\abl}){A_St}
\pnode(*1 {\myFunk}){B}
\pnode(*nBx {\abl}){B_St}

%\uput*[-90](A){\small$\Epkt{}{x_0}{f(x_0)}$}
%\uput*[-90](B){\small$\Epkt{}{x}{f(x)}$}

\pnode(!nAx nA_Sty 1 nA_Sty dup mul add sqrt div 2 mul sub nAy 1 1 nA_Sty dup mul add sqrt div 2 mul add){H}
\pnode(!nBx nB_Sty 1 nB_Sty dup mul add sqrt div 1.4 mul sub nBy 1 1 nB_Sty dup mul add sqrt div 1.4 mul add){V}
\psdot[linecolor=red](H)
\psdot[linecolor=red](V)
\uput[90](H){H}
\uput[90](V){V}
\pscircle[dimen=outer,linecolor=gray](H){2}
\pscircle[dimen=outer,linecolor=gray](V){1.4}

\pcline[linecolor=red](H)(V)\naput{$R$}
\pcline[linecolor=blue](H)(A)\naput{$r_1$}
\pcline[linecolor=blue](V)(B)\naput{$r_2$}

\pcline[linecolor=gray,linestyle=dashed](H)(!nHx nVy)\nbput{$r_1-r_2$}
\pcline[linecolor=gray,linestyle=dashed](!nHx nVy)(!nVx nVy)\nbput{$\sqrt{R^2-(r_1-r_2)^2}$}

\pnode(!nHx nVy){X}

\pstMarkAngle[linecolor=red,arrows=->,MarkAngleRadius=4.5,LabelSep=3.6]{H}{V}{X}{\color{red}$\alpha$}
\end{pspicture}

The initial inclination angle $\alpha$ of the line between front wheel axis and back wheel axis on a horizontal plane is :
\begin{equation*}
  \alpha=\arctan\left(\frac{r_1-r_2}{\sqrt{R^2-(r_1-r_2)^2}}\right)
\end{equation*}
If the plane is not horizontal, there is an additional angle $\beta$ given by the function $f(x)$:

\psset{saveNodeCoors,NodeCoorPrefix=n,algebraic}
\def\myFunk{0}
\def\abl{Derive(1,\myFunk)}
\begin{pspicture}(-10,0)(8,5.5)
\rput{-20}{
\psplot{-8}{4}{\myFunk}
\pnode(*-5 {\myFunk}){A}
\pnode(*nAx {\abl}){A_St}
\pnode(*1 {\myFunk}){B}
\pnode(*nBx {\abl}){B_St}
\psdot(A)
\psdot(B)
\uput*[-90](A){\small$\Epkt{}{x_0}{f(x_0)}$}
\uput*[-90](B){\small$\Epkt{}{x}{f(x)}$}

\pnode(!nAx nA_Sty 1 nA_Sty dup mul add sqrt div 2 mul sub nAy 1 1 nA_Sty dup mul add sqrt div 2 mul add){H}
\pnode(!nBx nB_Sty 1 nB_Sty dup mul add sqrt div 1.4 mul sub nBy 1 1 nB_Sty dup mul add sqrt div 1.4 mul add){V}
\psdot[linecolor=red](H)
\psdot[linecolor=red](V)
\uput[90](H){H}
\uput[90](V){V}
\pscircle[dimen=outer,linecolor=gray](H){2}
\pscircle[dimen=outer,linecolor=gray](V){1.4}

\pcline[linecolor=red](H)(V)\naput{$R$}
\pcline[linecolor=blue](H)(A)\naput{$r_1$}
\pcline[linecolor=blue](V)(B)\naput{$r_2$}

\pcline[linecolor=gray,linestyle=dashed](H)(!nHx nVy)\nbput{$r_1-r_2$}
\pcline[linecolor=gray,linestyle=dashed](!nHx nVy)(!nVx nVy)\nbput{$\sqrt{R^2-(r_1-r_2)^2}$}

\pnode(!nHx nVy){X}

\pstMarkAngle[linecolor=red,arrows=->,MarkAngleRadius=4.5,LabelSep=3.6]{H}{V}{X}{\color{red}$\alpha$}
}

\rput(H){%
\pcline[linestyle=dashed](0,0)(5.5,0)\naput{$x_V-x_H$}
\pcline[linestyle=dashed](5.5,0)(V)\naput{$y_V-y_H$}
}
\uput{1cm}[-13](H){\color{blue}$\beta$}
\end{pspicture}

The coordinates of the front wheel axis are:
\begin{equation*}
\overrightarrow{FW}=\vec{x}+r_2\cdot \vec{n}_{0x}
=\begin{pmatrix}
x-r_2\frac{f'(x)}{\sqrt{1+f'(x)^2}}\\
f(x)+r_2\frac{1}{\sqrt{1+f'(x)^2}}
\end{pmatrix}
=\begin{pmatrix}
x_V\\y_V
\end{pmatrix}
\end{equation*}
The coordinates of the back wheel axis are:
\begin{equation*}
\overrightarrow{BW}=\vec{x}_0+r_1\cdot \vec{n}_{0x_0}
=\begin{pmatrix}
x_0-r_1\frac{f'(x_0)}{\sqrt{1+f'(x_0)^2}}\\
f(x_0)+r_1\frac{1}{\sqrt{1+f'(x_0)^2}}
\end{pmatrix}
=\begin{pmatrix}
x_H\\y_H
\end{pmatrix}
\end{equation*}
The angle $\beta$ is:
\begin{equation*}
\beta=\arctan\left(\frac{y_V-y_H}{x_V-x_H}\right)
\end{equation*}
The total angle $\gamma$ is:
\begin{equation*}
  \gamma=-(\alpha+\beta)
\end{equation*}



\subsection{Rolling without slipping}

\textbf{Important note:} There is a limitation for the radii. The radii $r$ of the wheels of the vehicle need to be smaller than the minimal curvature radius $\varrho$ of the given curve.

At points of inflection, the curvature radius is $\infty$. The curvature radius $\varrho$ is calculated with the following formula:
\begin{equation*}
\varrho=\frac{\sqrt{(1+f'(x)^2)^3}}{f''(x)}
\end{equation*}
The condition for \emph{rolling without slipping} is
\begin{equation*}
\omega=\left(\frac{1}{r}-\frac{1}{\varrho}\right)\cdot \dot{s},
\end{equation*}
where $s$ is the length along the curve of the function $f$.

With
\begin{equation*}
\omega=\frac{\text{d}\varphi}{\text{d}t}\quad\text{ and }\quad \dot{s}=\sqrt{1+f'(x)^2}\cdot\frac{\text{d}x}{\text{d}t}
\end{equation*}
this finally leads to
\begin{equation*}
\text{d} \varphi=\left(\frac{1}{r}-\frac{1}{\varrho}\right)\cdot\sqrt{1+f'(x)^2}\,\text{d}x
\end{equation*}



\section{Predefined vehicles}

This package contains a number of predefined vehicles, like \emph{Bike}, \emph{Tractor}, \emph{Highwheeler}, \emph{Truck}, \emph{Segway}, \emph{Unicycle}. The last two of the vehicles only contain one axis, the rest has two axes.

Except the mono-cycles, a vehicle is defined by the radius of each wheel, [\texttt{rB}] for the rear (back) wheel and [\texttt{rF}] for the front wheel and the distance [\texttt{d}] between the axes of the two wheels. Their values must be given within the options of the \texttt{\textbackslash psVehicle [options]} command. The cladding of a vehicle, auto body or bicycle frame must of course be adapted to the dimensions indicated above. A number of types of wheels and vehicles have been predefined.

We also setup some \verb+\newpsstyle+ for each of the vehicles, where the dimensions and the choice of the wheels are setup like we would choose them.
\begin{lstlisting}
\newpsstyle{segway}{rB=1.4,backwheel=\segWheel}%MonoAxis
\newpsstyle{unicycle}{rB=1.6,backwheel=\SpokesWheelB}%MonoAxis
\newpsstyle{tractor}{d=4,rB=1.4,rF=1.0}
\newpsstyle{truck}{backwheel=\TruckWheel,frontwheel=\TruckWheel,d=6.28,rB=1.9,rF=1.9}
\newpsstyle{bike}{backwheel=\SpokesWheelB,frontwheel=\SpokesWheelB,d=5.8,rB=1.6,rF=1.6}
\end{lstlisting}
Here follows a list of the vehicles that come along with the package:



\subsection{\textbackslash Bike}

\begin{LTXexample}[pos=l,width=4cm]
\begin{pspicture}(0,0)(4,3)
\def\FuncA{1*cos(x)+1}
\psframe*[linecolor=yellow!10](0,0)(4,3)
\psgrid[style=quadrillage](0,0)(4,3)
\psplot{0}{4}{\FuncA}
\psVehicle[vehicle=\Bike,showSlope]{0.25}{1.2}{\FuncA}
\end{pspicture}
\end{LTXexample}



\subsection{\textbackslash Tractor}

\begin{LTXexample}[pos=l,width=4cm]
\begin{pspicture}(-1,4)(3,7)
\def\funkg{sqrt(-x^2+2*x*10+1)}
\psframe*[linecolor=yellow!10](-1,4)(3,7)
\psgrid[style=quadrillage](-1,4)(3,7)
\psplot[plotpoints=500,algebraic]{0.5}{4}{\funkg}
\psVehicle[vehicle=\Tractor,showSlope=false]{0.5}{1}{\funkg}
\end{pspicture}
\end{LTXexample}



\subsection{\textbackslash HighWheeler}

\begin{LTXexample}[pos=l,width=4cm]
\begin{pspicture}(0,-1)(4,3)
\def\FuncA{-0.25*(x-2)^2+0.5}
\psframe*[linecolor=yellow!10](0,-1)(4,3)
\psgrid[style=quadrillage](0,-1)(4,3)
\psplot[yMinValue=0]{0}{4}{\FuncA}
\psVehicle[vehicle=\HighWheeler]{0.25}{1.2}{\FuncA}
\end{pspicture}
\end{LTXexample}



\subsection{\textbackslash Truck}

\begin{LTXexample}[pos=l,width=4cm]
\begin{pspicture}(0,-1)(4,3)
\def\FuncA{0.3*1.6^x}
\psframe*[linecolor=yellow!10](0,-1)(4,3)
\psgrid[style=quadrillage](0,-1)(4,3)
\psplot{0}{4}{\FuncA}
\psVehicle[vehicle=\Truck,style=truck]{0.3}{1.2}{\FuncA}
\end{pspicture}
\end{LTXexample}



\subsection{\textbackslash Segway}

\begin{LTXexample}[pos=l,width=4cm]
\begin{pspicture}(0,-1)(4,4)
\def\FuncA{(x-3)*sin(0.2*(x-1))+1}
\psframe*[linecolor=yellow!10](0,-1)(4,4)
\psgrid[style=quadrillage](0,-1)(4,4)
\psplot{0}{4}{\FuncA}
\psVehicle[vehicle=\Segway,style=segway]{0.25}{1.2}{\FuncA}
\end{pspicture}
\end{LTXexample}



\subsection{\textbackslash UniCycle}

\begin{LTXexample}[pos=l,width=4cm]
\begin{pspicture}(0,0)(4,4)
\def\FuncA{(x-3)*sin(0.2*(x-1))+1}
\psframe*[linecolor=yellow!10](0,0)(4,4)
\psgrid[style=quadrillage](0,0)(4,4)
\psplot{0}{4}{\FuncA}
\psVehicle[vehicle=\UniCycle,style=unicycle,showSlope=false]{0.5}{2.2}{\FuncA}
\end{pspicture}
\end{LTXexample}



\section{Predefined wheels}

In this section we present the predefined wheels that can be used for the front or back wheel.



\subsection{\textbackslash wheelA}

\begin{LTXexample}[pos=l,width=2cm]
\begin{pspicture}(-1,-1)(1,1)
\rput(!/rB 1 def 0 0){\wheelA}
\end{pspicture}
\end{LTXexample}



\subsection{\textbackslash{}wheelB}

\begin{LTXexample}[pos=l,width=2cm]
\begin{pspicture}(-1,-1)(1,1)
\rput(!/rB 1 def 0 0){\wheelB}
\end{pspicture}
\end{LTXexample}



\subsection{\textbackslash wheelC}

\begin{LTXexample}[pos=l,width=2cm]
\begin{pspicture}(-1,-1)(1,1)
\rput(!/rB 1 def 0 0){\wheelC}
\end{pspicture}
\end{LTXexample}



\subsection{\textbackslash wheelD}

\begin{LTXexample}[pos=l,width=2cm]
\begin{pspicture}(-1,-1)(1,1)
\rput(!/rB 1 def 0 0){\wheelD}
\end{pspicture}
\end{LTXexample}



\subsection{\textbackslash arrowWheel}

\begin{LTXexample}[pos=l,width=2cm]
\begin{pspicture}(-1,-1)(1,1)
\rput(!/rB 1 def 0 0){\arrowWheel}
\end{pspicture}
\end{LTXexample}



\subsection{\textbackslash TruckWheel}

\begin{LTXexample}[pos=l,width=2cm]
\begin{pspicture}(-1,-1)(1,1)
\rput(!/rB 1 def 0 0){\TruckWheel}
\end{pspicture}
\end{LTXexample}



\subsection{\textbackslash segWheel}

\begin{LTXexample}[pos=l,width=2cm]
\begin{pspicture}(-1,-1)(1,1)
\rput(!/rB 1 def 0 0){\segWheel}
\end{pspicture}
\end{LTXexample}



\subsection{\textbackslash SpokesWheelCrossed}

\begin{LTXexample}[pos=l,width=2cm]
\begin{pspicture}(-1,-1)(1,1)
\rput(!/rB 1 def 0 0){\SpokesWheelCrossed}
\end{pspicture}
\end{LTXexample}



\subsection{\textbackslash SpokesWheelA}

\begin{LTXexample}[pos=l,width=2cm]
\begin{pspicture}(-1,-1)(1,1)
\rput(!/rB 1 def 0 0){\SpokesWheelA}
\end{pspicture}
\end{LTXexample}



\subsection{\textbackslash TractorFrontWheel}

\begin{LTXexample}[pos=l,width=2cm]
\begin{pspicture}(-1,-1)(1,1)
\rput(!/rF 1 def 0 0){\TractorFrontWheel}
\end{pspicture}
\end{LTXexample}



\subsection{\textbackslash TractorRearWheel}

\begin{LTXexample}[pos=l,width=2cm]
\begin{pspicture}(-1,-1)(1,1)
\rput(!/rB 1 def 0 0){\TractorRearWheel}
\end{pspicture}
\end{LTXexample}



\section{How to use the command}

This package offers the following command:

\begin{BDef}
\Lcs{psVehicle}\OptArgs\Largb{scaling factor}\Largb{abscissa back wheel}\Largb{equation function}
\end{BDef}

\textbf{Important note:} The function has to be given in algebraic notation and not in RPN.

The package \LPack{pst-vehicle} contains the options \nxLkeyword{epsilon=}, \nxLkeyword{rB=}, \nxLkeyword{rF=}, \nxLkeyword{d=}, \nxLkeyword{gang=}, \nxLkeyword{vehicle=}, \nxLkeyword{ownvehicle=}, \nxLkeyword{backwheel=}, \nxLkeyword{frontwheel=}, \nxLkeyword{MonoAxis=} and \nxLkeyword{showSlope=}
\begin{quote}
\begin{tabularx}{\linewidth}{ @{} l >{\ttfamily}l X @{} }\toprule
\emph{Name}           & \emph{Default} & \emph{Meaning} \\\midrule
\Lkeyword{epsilon}     & 1e-6          & Increment\\
\Lkeyword{rB}    & 1.6             & Radius of the back wheel\\
\Lkeyword{rF}  & 1.6   & Radius of the front wheel\\
\Lkeyword{d}  & 5.8   & Distance between front and back wheel axes\\
\Lkeyword{gang}  & 1   & Transmission between pedals and back wheel\\
\Lkeyword{vehicle}  & \texttt{\textbackslash Bike}   & The Bike is chosen by default\\
\Lkeyword{ownvehicle}  &   & Used to generate custom vehicle\\
\Lkeyword{backwheel}  & \texttt{\textbackslash wheelA}   & wheelA is chosen by default\\
\Lkeyword{frontwheel}  & \texttt{\textbackslash wheelA}   & wheelA is chosen by default\\
\Lkeyword{MonoAxis}  & false   & if the vehicle has one axis\\
\Lkeyword{showSlope}  & true   & showing the slope of the vehicle\\
\bottomrule
\end{tabularx}
\end{quote}



\section{The Slope-o-Meter}

A very nice gadget to show the angle of the slope of the vehicle on the curve. A fine thing for animations as you will see within the section Animation \ldots

This command is shipped with two arguments to customize it with the \emph{color of appearance} and the \emph{angle of the pointer}.

\textbf{Note:} The name \emph{Slope-o-Meter} is not at all an academically correct notation, but we all together had great fun to give it that special name.
\begin{LTXexample}[pos=l,width=5cm]
\begin{pspicture}(-2.5,-2.5)(2.5,2.5)
\pstVerb{/omega 30 def}
\rput(0,0){\SlopeoMeter{cyan!90}{omega}}
\end{pspicture}
\end{LTXexample}



\section{Examples}

\subsection{Predefined vehicle with custom wheels}

\begin{LTXexample}[pos=l,width=7cm]
\begin{pspicture}(1,1)(8,6)
\def\FuncA{0.5*cos(x)+2}
\psframe*[linecolor=yellow!10](1,1)(8,6)
\psgrid[style=quadrillage](1,1)(8,6)
\psplot{1}{8}{\FuncA}
\psVehicle[vehicle=\Truck,showSlope=false,frontwheel=\wheelC,backwheel=\arrowWheel,rB=1,rF=1]{0.5}{3.2}{\FuncA}
\end{pspicture}
\end{LTXexample}



\subsection{Custom vehicle}

To design your own vehicle, there are just a few rules to follow:
\begin{itemize}
\item Choose \nxLkeyword{vehicle=\textbackslash SelfDefinedVehicle}
\item No need to draw the wheels---just choose one of the predefined---or define your own wheels and then choose them with the options \nxLkeyword{backwheel=} and \nxLkeyword{frontwheel=}
\item \textbf{Important note:} The axe of the back wheel is hard programmed at: \Epkt{O}{0}{0}
\item The front wheel position is automatically calculated with the given distance between the two axes \nxLkeyword{d=}
\item Draw your vehicle as if it stands on a horizontal plane, then define it and set it with i.\,e. \nxLkeyword{ownvehicle=\textbackslash myVeh} as shown in the example below.
\end{itemize}
\begin{LTXexample}[pos=l,width=5cm]
\def\myVeh{\psframe*[linecolor=red](-1,-0.25)(5,2)}
\begin{pspicture}(2,1)(7,4)
\def\FuncA{0.5*sin(x)+2}
\psframe*[linecolor=yellow!10](2,1)(7,4)
\psgrid[style=quadrillage](2,1)(7,4)
\psplot{2}{7}{\FuncA}
\psVehicle[vehicle=\SelfDefinedVehicle,ownvehicle=\myVeh,showSlope=false,frontwheel=\wheelA,backwheel=\wheelB,rB=1,rF=1,d=4]{0.5}{3.2}{\FuncA}
\end{pspicture}
\end{LTXexample}

The same body of the vehicle is chosen as within the example above, but the front wheel has a smaller radius.

\begin{LTXexample}[pos=l,width=5cm]
\def\myVeh{\psframe*[linecolor=red](-1,-0.25)(5,2)}
\begin{pspicture}(2,1)(7,4)
\def\FuncA{0.5*sin(x)+2}
\psframe*[linecolor=yellow!10](2,1)(7,4)
\psgrid[style=quadrillage](2,1)(7,4)
\psplot{2}{7}{\FuncA}
\psVehicle[vehicle=\SelfDefinedVehicle,ownvehicle=\myVeh,showSlope=false,frontwheel=\wheelA,backwheel=\wheelB,rB=1,rF=0.7,d=4]{0.5}{3.2}{\FuncA}
\end{pspicture}
\end{LTXexample}



\section{Animation}

\begin{LTXexample}[pos=t,width=15cm]
\def\funkg{0.25*(x-3)*sin(0.2*(x-2))-1}
\begin{animateinline}[controls,palindrome,
    begin={\begin{pspicture}(-2,-2)(13,3)},
    end={\end{pspicture}}]{20}% 20 frames/s (velocity of the animation)
\multiframe{100}{rB=0+0.05}{% number of frames
\psframe*[linecolor=cyan!20](-2,-2)(13,4)
\pscustom[fillstyle=solid,fillcolor={[RGB]{174 137 100}},linestyle=none]{
\psplot[plotpoints=500,algebraic]{-2}{13}{\funkg}
\psline(13,-2)(-2,-2)
\closepath}
\psplot[plotpoints=500,algebraic]{-2}{13}{\funkg}
\psVehicle[vehicle=\Bike,style=bike,linecolor=DodgerBlue4]{0.4}{\rB}{\funkg}
\rput(10.5,0.5){\SlopeoMeter{cyan!90}{omega}}
}
\end{animateinline}
\end{LTXexample}


\clearpage


\section{List of all optional arguments for \texttt{pst-vehicle}}

\xkvview{family=pst-vehicle,columns={key,type,default}}


\clearpage


\nocite{*}
\bgroup
\RaggedRight
\printbibliography
\egroup


\printindex
\end{document}