diff options
author | Y. Wang <yw05@forksworld.de> | 2021-11-26 20:51:49 +0100 |
---|---|---|
committer | Y. Wang <yw05@forksworld.de> | 2021-11-26 20:51:49 +0100 |
commit | c755265862e0c1c23ee2c43cce17a58df6182298 (patch) | |
tree | d5f86e4bd804373be72c767ecfd95353163a4c03 /assets | |
parent | f26623f102f728fa32b91df97339bc0230213315 (diff) | |
download | advtrains-c755265862e0c1c23ee2c43cce17a58df6182298.tar.gz advtrains-c755265862e0c1c23ee2c43cce17a58df6182298.tar.bz2 advtrains-c755265862e0c1c23ee2c43cce17a58df6182298.zip |
Add cheatsheet for acceleration distance
Diffstat (limited to 'assets')
-rw-r--r-- | assets/manual2/acceleration-distance.ps | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/assets/manual2/acceleration-distance.ps b/assets/manual2/acceleration-distance.ps new file mode 100644 index 0000000..e6d2541 --- /dev/null +++ b/assets/manual2/acceleration-distance.ps @@ -0,0 +1,63 @@ +%!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 + 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 |