# How to find angles, which lies between -π and -2π.Because matlab returns only values between ±π using atan or atand function.

12 views (last 30 days)
gfgf99 on 2 Jun 2015
Commented: Walter Roberson on 2 Jun 2015
Because matlab returns only values between ±π using 'atan' or 'atand 'functions.i want to get an angle between -π and -2π. Are there any solution to do that using functions? i'm finding a solution without using a absolute value(abs function)
thank you

gfgf99 on 2 Jun 2015
simply, i want to plot(scatter) angles without discontinuity which range are lying between 0 to 2π .ex: circular data points(point cloud) angles.
Walter Roberson on 2 Jun 2015
Yes, use unwrap(). It will get rid of discontinuities.

Roger Stafford on 2 Jun 2015
Do this to your angle, 'a':
a = mod(a,pi)-2*pi;
It will then lie between -2*pi and -pi.
[Note: atan gives angles between -pi/2 and +pi/2, not -pi and +pi.]

#### 1 Comment

gfgf99 on 2 Jun 2015
can you explain this? i tried this but not solved my problem .