I need my angles in the [-pi:pi] range instead of [0:2*pi]?
Show older comments
I have an angle in degrees, 225 degrees. Now degtorad(225) function gives me:
>>degtorad(225)
ans =
3.9270 radians
above 'ans' is in the range 0:2pi
I want to know the procedure that i get an answer in the range -pi:pi, as 225 degrees is also equal to -2.3562 radians
225 degree=3.9270 rad
225 degree=-2.3562 rad.
I hope I have made my point clear.
Thank you in advance.
2 Comments
krishna teja
on 24 Jul 2021
Walter Roberson
on 28 Jul 2021
Good point, @krishna teja, wrapToPi should work well... at least for people who have the Mapping Toolbox.
Accepted Answer
More Answers (0)
Categories
Find more on Lengths and Angles 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!