function quadCheck, angle ;returns the quadrant of the input angle (in radians) tAngle = angle if tAngle lt 0 then tAngle = tAngle + 2*!pi if tAngle gt 2*!pi then tAngle = tAngle - 2*!pi if tAngle ge 0 and tAngle le !pi/2 then begin quadrant = 1 endif else if tAngle gt !pi/2 and tAngle le !pi then begin quadrant = 2 endif else if tAngle gt !pi and tAngle le 3*!pi/2 then begin quadrant = 3 endif else if tAngle gt 3*!pi/2 and tAngle le 2*!pi then begin quadrant = 4 endif return, quadrant end