comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: vectors with same length
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: vectors with same length [message #61766] Mon, 28 July 2008 14:44 Go to next message
Kenneth P. Bowman is currently offline  Kenneth P. Bowman
Messages: 585
Registered: May 2000
Senior Member
In article
<e8c1f958-1621-4dba-9f10-ebba593e2de9@d1g2000hsg.googlegroups.com>,
knielsen73@gmail.com wrote:

> Hi,
>
> I am using velovect to create a vector plot. I would like for all the
> vectors to have the same length instead of the length representing
> amplitude. Is there are quick way to do this using velovect, or do I
> have to modify velovect?
>
> Thanks,
> Kim

Just divide each vector by it's magnitude. Given vector components u and v

mag = SQRT(u^2 + v^2)

VELOVECT, u/mag, v/mag

Watch out for zeroes, though.

Ken Bowman
Re: vectors with same length [message #61768 is a reply to message #61766] Mon, 28 July 2008 14:53 Go to previous message
Chris[6] is currently offline  Chris[6]
Messages: 84
Registered: July 2008
Member
On Jul 28, 11:31 am, knielse...@gmail.com wrote:
> Hi,
>
> I am using velovect to create a vector plot. I would like for all the
> vectors to have the same length instead of the length representing
> amplitude. Is there are quick way to do this using velovect, or do I
> have to modify velovect?
>
> Thanks,
>  Kim

Wouldn't it be easy to divide your data by their lengths, so that they
all have length one?

velovect, u/sqrt(u^2+v^2), v/sqrt(u^2+v^2), x, y

chris
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: vectors with same length
Next Topic: Finding the Top Two Most Common Coordinates in a Multi-Dimensional Array

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Sat Oct 11 12:38:34 PDT 2025

Total time taken to generate the page: 1.03970 seconds