% antimattermeteor.mp
% L. Nobre G.
% 2008

input featpost3Dplus2D;

% bash: export TEX=latex
% tcsh: setenv TEX latex

%prologues := 0;

% verbatimtex
% \documentclass{article} 
% \usepackage{beton,concmath,ccfonts} 
% \begin{document} 
% etex

f := (30,0,0);
Spread := 100;

numeric initdist, timestep, Gfactor, vprobe;
inidist = 10;
timestep = 0.1;
Gfactor = 2;
vprobe = 2.2;
numeric numsteps, numtries, diststep, i, sigma;
color inipos, inivel, dstp;
path traject;

def gravitfield( expr relatposprobe ) =
  ( Gfactor*relatposprobe/((conorm( relatposprobe ))**3) )
enddef;

vardef scalarfu( expr index ) =
  traject:=trajectorypath(
    numsteps,
    inipos+index*dstp,
    inivel,
    timestep)(gravitfield);
  draw traject;
enddef;

beginfig(1);
  numtries = 36;
  numsteps = 95;
  sigma = 3.15;
  diststep = sigma/numtries;
  dstp = (0,0,diststep);
  inipos = (0,-inidist,0);
  inivel = (0,vprobe,0);
  drawoptions( withcolor blue );
  for i=-numtries upto numtries:
    scalarfu( i );
  endfor;
  drawoptions();
  fill fullcircle scaled (4cm) shifted (rp(black));
  produce_auto_scale;
endfig;

% verbatimtex 
% \end{document} 
% etex

end.
