aboutsummaryrefslogtreecommitdiff
path: root/assets/manual/acceleration-distance.ps
blob: 56fe8b89e399be9b0fdc8b837ae195a63923b9ef (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
%!PS

/Courier 12 selectfont
1 setlinewidth

/pagewidth 595 def
/pageheight 842 def
/entrywidth 25 def
/entryheight 15 def
/nrows 25 def
/ncols 22 def

/dupsecond {
    exch dup 3 1 roll
} def

/duptwo {
    dupsecond dupsecond
} def

/movetorc {
    exch entrywidth mul pagewidth entrywidth ncols mul sub 2 idiv add
    exch entryheight mul pageheight entryheight nrows mul sub 2 idiv add pageheight exch sub
    moveto
} def

/integer-string {
    dup abs 1 add log floor 2 add cvi string cvs
} def

/showint {
    integer-string show
} def

/get-acceleration {
    2 mul 3 1 roll dup mul exch dup mul sub exch div ceiling cvi
} def

<< /PageSize [pagewidth pageheight]>> setpagedevice

[ -10 -3 -2 -0.5 0.5 1 1.5 ]
{
    dup 0 eq
    { pop }
    {
	-1 1 21 {
	    dup 0 exch newpath movetorc -1 -4 rmoveto 22 entrywidth mul 0 rlineto closepath stroke
	    1 add 0 movetorc -1 11 rmoveto 0 -22 entryheight mul rlineto closepath stroke
	} for
	newpath 22 21 movetorc -1 -4 rmoveto 0 -3 entryheight mul rlineto -22 entrywidth mul 0 rlineto 0 3 entryheight mul rlineto closepath stroke
	0 1 20 {
	    dup dup 1 add 0 movetorc showint
	    dup dup 1 add 0 exch movetorc showint
	    0 1 20 {
		dupsecond duptwo 1 add exch 1 add exch movetorc 3 index get-acceleration 0 dupsecond lt {showint} {pop} ifelse
	    } for
	    pop
	} for
	0 22 movetorc (Acc. =) show 2 22 movetorc 5 string cvs show
	0 23 movetorc (The horizontal axis stands for the current speed.) show
	0 24 movetorc (The vertical axis stands for the target speed.) show
	showpage
    } ifelse
} forall