How can I graph a set of polar coordinates with unique origins?
2 views (last 30 days)
Show older comments
I have a set of points in the format x, y, r, Θ. At each point (x, y), there is a radius pointing out of distance r in direction Θ. Is there an easy method to graph these points directly without converting to Euclidean coordinates?
0 Comments
Answers (1)
Walter Roberson
on 18 Jun 2015
No. But at least you can do them all at the same time.
starts = [x(:), y(:)];
[rx, ry] = pol2cart(theta(:), r(:));
ends = starts + [rx, ry];
and then you have to plot them. A trick for that:
xlist = [starts(:,1), ends(:,1), nan(size(starts,1),1)] .';
ylist = [starts(:,2), ends(:,2), nan(size(starts,1),1)] .';
plot( xlist(:), ylist(:) );
0 Comments
See Also
Categories
Find more on Polar Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!