[Thread Prev][Thread Next][Index]

Re: [ferret_users] Constant lenght for vectors



Hi Tony,

| I would like to plot vectors with a constant length, [...]
|

What you want is to scale the vectors according to
(us,vs) = (u,v) / |(u,v)| .    In ferret,

   let mag = (u*u + v*v)^0.5  !!<-- length of the vector
   let us  = u/mag            !!<-- scaled
   let vs  = v/mag

   vector us,vs  !!<-- draw

A nice thing about this is that us and vs become "missing"
where mag == 0, so that the vector isn't drawn there.

Hope this helps,
Ryo

[Thread Prev][Thread Next][Index]

Dept of Commerce / NOAA / OAR / PMEL / TMAP

Contact Us | Privacy Policy | Disclaimer | Accessibility Statement