How can I use cart2pol?

Hello
cart2pol returns angles between -pi and pi, what I can do to have angles between 0 and 2*pi (0 and 360). thanks

 Accepted Answer

mod(theta, 2*pi)
See also the unwrap() function.

3 Comments

Pamela
Pamela on 1 Nov 2012
Edited: Pamela on 1 Nov 2012
Thak you sir
These lines
[ang,rho] = cart2pol(x,y);
ang = ((ang/(2*pi)) * 360);%convert to degrees orientation
give me this result
ang =
-117.6064
-117.7249
-117.8443
when I add this line
ang=mod(ang, 2*pi)
I have this result
ang =
1.7741
1.6556
1.5362
It's not correct?
The mod() is to be applied to the angle in radians, which is what you had asked about. Convert to degrees after you do the mod()
thanks

Sign in to comment.

More Answers (0)

Categories

Find more on MATLAB Production Server in Help Center and File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!