The Math Forum

Search All of the Math Forum:

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

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

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

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 ]

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);


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

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.