diff options
Diffstat (limited to 'Master/texmf-dist/doc/metapost/featpost/example/fallinthewind.mp')
-rw-r--r-- | Master/texmf-dist/doc/metapost/featpost/example/fallinthewind.mp | 70 |
1 files changed, 37 insertions, 33 deletions
diff --git a/Master/texmf-dist/doc/metapost/featpost/example/fallinthewind.mp b/Master/texmf-dist/doc/metapost/featpost/example/fallinthewind.mp index 4e54429b3ed..f4984971b67 100644 --- a/Master/texmf-dist/doc/metapost/featpost/example/fallinthewind.mp +++ b/Master/texmf-dist/doc/metapost/featpost/example/fallinthewind.mp @@ -1,22 +1,22 @@ % fallinthewind.mp % L. Nobre G. -% 2007 +% 2014 input featpost3Dplus2D; -Spread := 40; -%f := 0.5[0.3*(15,10,5),0.3*(1.5,1,15)]; -f := 1.5*(2.5,1.7,1.5); -viewcentr := (0,0,0.96); -%show f; - prologues := 1; +Spread := 9; +f := 4.5*(2.5,-1.3,1.7); +viewcentr := (0,0,2); +background := 0.9white; + color referencewind; -numeric dragcoeff, horangle, quadcoef; +numeric dragcoef, dragcoeg, horangle, quadcoef; horangle = 90; referencewind = red*cosd( horangle ) + green*sind( horangle ); -dragcoef = 0.045; +dragcoef = 0.065; +dragcoeg = 0.009; quadcoef = 0.99; def vecfunc( expr posit, veloc )= @@ -25,47 +25,51 @@ def vecfunc( expr posit, veloc )= color wind, field, blow; numeric heig, wint; heig = Z( posit ); - wind = referencewind*quadcoef*(( heig+0.0001 )**2); + wind = referencewind*quadcoef*sqrt( heig+0.05 ); wind := wind-veloc; wint = conorm( wind ); blow = N( wind ); - field = dragcoef*blow*wint-blue; + field = (dragcoef+dragcoeg*wint)*wind-blue; ( field ) endgroup enddef; beginfig(1); - numeric i, numa, sa, ea, diffstep, ray; + numeric i, j, k, numa, sa, ea, diffstep, ray; color stp, svl, arrbe, arren; - path oneline; + path oneline[]; pen grossa, fina; - arrbe = (0,-5,1); - arren = (0,-3,1); - TDAtiplen := 0.5; - TDAhalftipbase := 0.2; - TDAhalfthick := 0.1; - grossa = pencircle scaled 3pt; - fina = pencircle scaled 2pt; - diffstep = 0.03; - ray = 2.2; -% numa = 0.02; -% sa = 106.4; -% ea = 106.6; - numa = 2; - sa = 80.5; - ea = 130.5; - setthestage( 20, 10 ); + arrbe = (0,-8,5); + arren = (0,-5.5,5); + setthestage( 18, 20 ); + TDAtiplen := 0.75; + TDAhalftipbase := 0.3; + TDAhalfthick := 0.15; + grossa = pencircle scaled 1.8pt; + fina = pencircle scaled 1.2pt; + diffstep = 0.015; + ray = 3.95; + numa = 3.45; + sa = 38; + ea = 142; + j = 0; for i=sa step numa until ea: + j := j+1; stp := black; svl := ray*(green*cosd(i)+blue*sind(i)); - oneline := dragtrajectorypath( stp, svl, diffstep, vecfunc ); - draw oneline; -% draw oneline withpen fina withcolor background; + oneline[j] := dragtrajectorypath( stp, svl, diffstep, vecfunc ); + draw oneline[j] withpen grossa withcolor white; + endfor; + for k=1 upto j: + draw oneline[k] withpen fina withcolor red; endfor; tdarrow( arrbe, arren ); + draw rp(black)--rp((0,0,4.5)) dashed withdots withpen fina withcolor blue; produce_vga_border; endfig; +end. + ray := 3.25; numeric min, rst; min = 0.5; @@ -98,5 +102,5 @@ for i=min step rst until ray: endfor; message " "; -end. + |