summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/generic/pst-vehicle
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2017-06-05 23:08:54 +0000
committerKarl Berry <karl@freefriends.org>2017-06-05 23:08:54 +0000
commit31ead02cd541572d668146cfbfcba137392aec8e (patch)
tree4ea744bc78b7f5fc545e7cb845a507d739dce426 /Master/texmf-dist/tex/generic/pst-vehicle
parentb28c826ecab866d192e2c0e589ad90931e6fcd4f (diff)
pst-vehicle (5jun17)
git-svn-id: svn://tug.org/texlive/trunk@44466 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/generic/pst-vehicle')
-rw-r--r--Master/texmf-dist/tex/generic/pst-vehicle/pst-vehicle.tex67
1 files changed, 42 insertions, 25 deletions
diff --git a/Master/texmf-dist/tex/generic/pst-vehicle/pst-vehicle.tex b/Master/texmf-dist/tex/generic/pst-vehicle/pst-vehicle.tex
index 83d4ff901a1..e4f84b3fffb 100644
--- a/Master/texmf-dist/tex/generic/pst-vehicle/pst-vehicle.tex
+++ b/Master/texmf-dist/tex/generic/pst-vehicle/pst-vehicle.tex
@@ -15,7 +15,6 @@
%% 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
@@ -28,8 +27,8 @@
\ifx\PSTXKeyLoaded\endinput\else\input pst-xkey.tex\fi
\ifx\PSTplotLoaded\endinput\else\input pst-plot.tex\fi
\ifx\PSTnodeLoaded\endinput\else\input pst-node.tex\fi
-\def\fileversion{1.0}
-\def\filedate{2017/05/29}
+\def\fileversion{1.1}
+\def\filedate{2017/06/05}
\message{`PST' v\fileversion, \filedate}
\edef\PstAtCode{\the\catcode`\@} \catcode`\@=11\relax
@@ -47,10 +46,13 @@
\define@key[psset]{pst-vehicle}{rB}[1.6]{\def\pst@rB{#1 }} %
\define@key[psset]{pst-vehicle}{gang}[1]{\def\pst@gang{#1 }} %
\define@key[psset]{pst-vehicle}{epsilon}[1e-6]{\def\pst@epsilon{#1 }} %
+\define@key[psset]{pst-vehicle}{startPos}[0]{\def\pst@startPos{#1 }} %
\define@boolkey[psset]{pst-vehicle}[Pst@]{showSlope}[true]{} %
\define@boolkey[psset]{pst-vehicle}[Pst@]{MonoAxis}[false]{} %
+%\define@boolkey[psset]{pst-vehicle}[Pst@]{EqValveStartPos}[true]{} %
\input{ListVehicles.tex}
-\psset[pst-vehicle]{gang=1,epsilon=1e-6,rB=1.6,rF=1.6,d=5.8,vehicle=\Bike,ownvehicle=,backwheel=\wheelA,frontwheel=\wheelA,showSlope=true,MonoAxis=false}
+\psset[pst-vehicle]{gang=1,epsilon=1e-6,rB=1.6,rF=1.6,d=5.8,vehicle=\Bike,ownvehicle=,backwheel=\wheelA,frontwheel=\wheelA,showSlope=true,%
+startPos=0,MonoAxis=false}
\psset{algebraic}
\def\psVehicle{\def\pst@par{}\pst@object{psVehicle}}%
\def\psVehicle@i#1#2#3{%
@@ -68,16 +70,19 @@
\pst@Verb{%
/rpn { tx@AlgToPs begin AlgToPs end cvx } def%
/x0 #2 def % -------------- x-Wert des Punktes auf der Kurve, wo das Hinterrad die Kurve ber\"{u}hrt; von diesem Wert startet die Rechnung
+ /XST \pst@startPos\space def % Untergrenze f\"{u}r die Integration bei der Rotationswinkelbestimmung
%---- % Definition of the function f(x), its first derivative f'(x) and \sqrt{1+f'(x)^2} Definition de la fonction et la premiere derivee
- /func (#3) rpn def
- /Diff (Derive(1,#3)) rpn def
- /DiffI (Derive(2,#3)) rpn def
- /dAB (sqrt(1+Diff^2)) rpn def
- /dABdiff (Derive(1,sqrt(1+(Derive(1,#3))^2))) rpn def
- /x x0 def func /funcx0 exch def % ----- f(x0)
- /x x0 def Diff /Diffx0 exch def % ----- f'(x0)
- /x x0 def DiffI /DiffIx0 exch def % --- f''(x0)
-% Calculating the length of the function between X1 and X2 ---- longueur de l'arc entre les points d'abscisse X1 et X2 %
+ /func (#3) rpn def
+ /Diff (Derive(1,#3)) rpn def
+ /DiffI (Derive(2,#3)) rpn def
+ /dAB (sqrt(1+Diff^2)) rpn def
+ /dABdiff (Derive(1,sqrt(1+(Derive(1,#3))^2))) rpn def
+ /x XST def func /funcxST exch def %---- f(XST)
+ /x XST def Diff /DiffxST exch def %---- f'(XST)
+ /x x0 def func /funcx0 exch def % ----- f(x0)
+ /x x0 def Diff /Diffx0 exch def % ----- f'(x0)
+ /x x0 def DiffI /DiffIx0 exch def % --- f''(x0)
+%-----------------------------------------------------------------------------------------------------------------------
/eps \pst@epsilon def
% Definition of a transmission between frontwheel and backwheel (interesting for vehicles with pedals) --- Gangschaltung
/Gang \pst@gang def
@@ -94,21 +99,27 @@
/tA 1 1 Diffx0 dup mul add sqrt div def%
/deltax0 tA Diffx0 mul rBs mul def
/deltay0 tA rBs mul def
+%-----------------------------------------------------------------------------------------------------------------------------------------
+/Function ((x-x0+rBs*Diffx0/(sqrt(1+(Diffx0)^2))-rFs*(Diff)/(sqrt(1+(Diff)^2)))^2+%
+ (func-funcx0+rFs/(sqrt(1+(Diff)^2))-rBs/(sqrt(1+(Diffx0)^2)))^2-dA12s^2) rpn def
+%-----------------------------------------------------------------------------------------------------------------------------------------
+/FunctionST ((x-XST+rBs*DiffxST/(sqrt(1+(DiffxST)^2))-rFs*(Diff)/(sqrt(1+(Diff)^2)))^2+%
+ (func-funcxST+rFs/(sqrt(1+(Diff)^2))-rBs/(sqrt(1+(DiffxST)^2)))^2-dA12s^2) rpn def
%--------- inferior value to search for the intersection point of the frontwheel with the curve
-/Xinf x0 def % ---------------------------------- Untergrenze f\"{u}r die Schnittpunktsuche des Vorderrades mit der Kurve
+/Zeros { %% Funktion xinf
+1 dict begin
+/Xinf exch def % ---------------------------------- Untergrenze f\"{u}r die Schnittpunktsuche des Vorderrades mit der Kurve
% superior value to search for the intersection point of the frontwheel with the curve = x0 + distance axes + radius frontwheel + radius backwheel
-/Xsup x0 dA12s add rBs rFs add add def % ---------- Obergrenze f\"{u}r die Schnittpunktsuche des Vorderrades mit der Kurve
+/Xsup Xinf dA12s add rBs rFs add add def % ---------- Obergrenze f\"{u}r die Schnittpunktsuche des Vorderrades mit der Kurve
%---% Calculating the intersection point of the frontwheel with the function------ Schnittpunktberechnung ---------------------------------
/NB 0 def %-----------------loop-variable ----- Laufvariable f\"{u}r loop
/NbreIterations 200 def % ---------- Maximum of iterations for the loop
-/Function ((x-x0+rBs*Diffx0/(sqrt(1+(Diffx0)^2))-rFs*(Diff)/(sqrt(1+(Diff)^2)))^2+%
- (func-funcx0+rFs/(sqrt(1+(Diff)^2))-rBs/(sqrt(1+(Diffx0)^2)))^2-dA12s^2) rpn def
{ %------------------------------------ loop begin ---------------------
/xM Xinf Xsup add 2 div def %--------- Mittelwert von xM = (Xinf + Xsup):2
/x Xinf def
- /F_1 Function def %----------------- F(Xinf)
+ /F_1 FUNK def %----------------- F(Xinf)
/x xM def %-------------------------
- /F_M Function def %----------------- F(xM)
+ /F_M FUNK def %----------------- F(xM)
F_M 0 eq {exit} if %---------------- if F(xM) = 0 --> exit
F_1 F_M mul 0 ge {/Xinf xM def} %-- F(Xinf) * F(xM) >= 0 Xinf = xM, else Xsup = xM
{/Xsup xM def}
@@ -117,7 +128,13 @@
/NB NB 1 add def %------------------- else loopvariable NB = NB + 1 Loopvariable um eins erh\"{o}hen
NB NbreIterations ge {exit} if %------ if number of iterations >= 200 --> exit
} loop
-/FWx xM def
+xM
+ end
+} def
+% \ifPst@EqValveStartPos
+/FUNK {FunctionST} def XST Zeros /FWxST exch def
+% \else /FWxST XST def \fi
+/FUNK {Function} def x0 Zeros /FWx exch def
/FWy /x FWx def func def %----------------------- Ber\"{u}hrpunkt des Vorderrades (FWx,FWy)
/mFWy /x FWx def Diff def %----------------------- mFWy = Tangentensteigung in (FWx,FWy)
/TermFW 1 1 mFWy dup mul add sqrt div def % 1/sqrt(1+f'(x_Q)^2)
@@ -134,9 +151,9 @@
X1 X2 /x {dPhiF} eps SIMPSON
} def
% % length of the curve for the wheels -- La longueur de la courbe pour la roue avant --- Kurvenl\"{a}nge
-/X1 0 def /X2 x0 def % Integral_{0}^{x0}
+/X1 XST def /X2 x0 def % Integral_{0}^{x0}
/sB AngleCumB def % ---backwheel - length from 0 to x0 ---- roue arri\`{e}re ---- Kurvenl\"{a}nge von 0 bis x0 (Hinterrad)
-/X2 FWx def
+/X1 FWxST def /X2 FWx def
/sF AngleCumF def % --frontwheel - length from 0 to the abscissa of the intersection frontwheel with curve - roue avant -- Kurvenl\"{a}nge von 0 bis zum SP Vorderrad - Kurve
%--------------------------------------------------------------------------------------------------------------------
%---% Definition angle of rotation for the backwheel --- Definition de l'angle de roue arriere ---- Rotationswinkel des Hinterrades
@@ -162,9 +179,9 @@
/gamma beta alpha add AFx ABx lt { 180 add } if def % gesamter Neigungswinkel des Fahrzeugs
%--------% Special case (mono-axis vehicle) Nr 4 --> segway ---------------------------------------------------------------------------
\ifPst@MonoAxis Diffx0 1 atan /omega exch def Diffx0 /mVehicle exch def \else FWy funcx0 sub FWx x0 sub div /mVehicle exch def mVehicle 1 atan /omega exch def \fi
-/normNorm x0 FWx sub FWy funcx0 sub div dup mul 1 add sqrt def
-/mTgy FWy funcx0 sub 0 eq { 1 } { x0 FWx sub FWy funcx0 sub div normNorm div } ifelse def
-/mTgx FWy funcx0 sub 0 eq { 0 } { 1 normNorm div } ifelse def
+/normNorm FWy funcx0 eq { 1 } { x0 FWx sub FWy funcx0 sub div dup mul 1 add sqrt } ifelse def
+/mTgy FWy funcx0 eq { 1 } { x0 FWx sub FWy funcx0 sub div normNorm div } ifelse def
+/mTgx FWy funcx0 eq { 0 } { 1 normNorm div } ifelse def
/xMTg x0 FWx add 2 div def
/yMTg funcx0 FWy add 2 div def
}%