Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: Plot vectors in polar coordinates
Replies: 7   Last Post: Nov 14, 2012 7:19 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Alex

Posts: 1
Registered: 11/14/12
Re: Plot vectors in polar coordinates
Posted: Nov 14, 2012 7:19 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

Use a rotation matrix ;)

xL = linspace(-4, 4, N);
yL = linspace(-4, 4, N);
[x y] = meshgrid(xL, yL);
ro = sqrt(x.*x + y.*y);
teta = atan2(y, x);

% Velocity in polar
vr = Vinf * (1-(R./ro).^2) .* cos(teta);
vt = -Vinf * (1+(R./ro).^2) .* sin(teta);

% Rotation
u = vr .* cos(teta) - vt.*sin(teta);
v = vr .* sin(teta) + vt.*cos(teta);

quiver(x,y,u,v)



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.