plot tangentail vector [message #58032] |
Sat, 12 January 2008 21:41  |
nakisa
Messages: 24 Registered: June 2007
|
Junior Member |
|
|
hi everybody
I need plot on each (x,y) a tangentail vector with known magnitude , I
have a file with three columns , x ,y , A.
where A is the magnitude of vector .
can anybody help me ?
best,nakisa
|
|
|
Re: plot tangentail vector [message #58078 is a reply to message #58032] |
Wed, 16 January 2008 05:44   |
JMB
Messages: 13 Registered: January 2008
|
Junior Member |
|
|
Does this short example help you?
N = 200
X = FINDGEN(N)
Y = 10*SIN(x/16)-10*COS(x/8+2)
A = abs(16*SIN(x[1:N-2]/4.))
PLOT, X, Y
vx=X[2:N-1]-X[1:N-2]
vy=(Y[2:N-1]-Y[0:N-3])/2.
Norm=A/sqrt(vx^2+vy^2)
ARROW,X[1:N-2],Y[1:N-2],X[1:N-2]+Norm*vx,Y[1:N-2]+Norm*vy,/
DATA,color=220
PLOT, X, Y, /noerase
END
Regards,
Jérôme
|
|
|
|
Re: plot tangentail vector [message #58192 is a reply to message #58078] |
Fri, 18 January 2008 21:58  |
nakisa
Messages: 24 Registered: June 2007
|
Junior Member |
|
|
hi Jerome
thanks but it isn't what I need. i want at each position (x,y) it
suppose a circle and plot a tangential vector with given magnitude !!!
nakisa
On Jan 16, 4:44 pm, JMB <jmb.lo...@gmail.com> wrote:
> Does this short example help you?
>
> N = 200
> X = FINDGEN(N)
> Y = 10*SIN(x/16)-10*COS(x/8+2)
> A = abs(16*SIN(x[1:N-2]/4.))
>
> PLOT, X, Y
>
> vx=X[2:N-1]-X[1:N-2]
> vy=(Y[2:N-1]-Y[0:N-3])/2.
>
> Norm=A/sqrt(vx^2+vy^2)
>
> ARROW,X[1:N-2],Y[1:N-2],X[1:N-2]+Norm*vx,Y[1:N-2]+Norm*vy,/
> DATA,color=220
> PLOT, X, Y, /noerase
>
> END
>
> Regards,
>
> Jérôme
|
|
|