MathGroup Archive 2007

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Projectile motion


Mike wrote:
> One more question. If animate the program, ymax at the end turns out to be some number on the order of 10^-9. I tried using Chop to round it to zero, but it doesn't work. Any ideas?

The function *Chop* accepts a second argument: "Chop[expr,delta] 
replaces numbers smaller in absolute magnitude than delta by 0."
(The default for delta is 10^-10.) So,

In[1]:=
data = Table[N[10]^(-n), {n, 12}];
Chop /@ data
(Chop[#1, 10^(-6)] & ) /@ data

Out[2]=
{0.1, 0.01, 0.001, 0.0001, 0.00001, 1.*^-6, 1.*^-7, 1.*^-8,
1.*^-9, 1.*^-10, 0, 0}

Out[3]=
{0.1, 0.01, 0.001, 0.0001, 0.00001, 1.*^-6, 0, 0, 0, 0, 0, 0}

-- 
Jean-Marc


  • Prev by Date: Re: Problems naming files with equation names
  • Next by Date: Re: Reproducible kernel crash
  • Previous by thread: Re: Projectile motion
  • Next by thread: How show Locator point and its image under a function?