Phase diagram of a rectangular pulse with Fourier Series - help understanding I understand perfectly fine how to plot the magnitude of a Fourier series, but I'm having serious trouble understanding how to plot the phase spectrum. Below is a picture of a rectangular pulse. The magnitude diagram makes sense to me - but how did they determine the phase diagram? 


I know that the coefficient is: 
$a = \frac{Asin(n*pi/2)}{n(pi/2)}$ or $Asinc(n*pi/2)$, but I'm not sure how to determine the phase spectrum from this.

I thought of using Euler's formula to convert the sine function, but then I'm a bit lost on how to use the exponential values to find the phase (if that's even correct?). So I got it to look like this:
$$a = \frac{A(e^{jn*pi/2}-e^{-jn*pi/2})}{(2jn*pi/2)}$$

But then.. I'm not really sure? Because in the diagram the angle is pi, but I can't see how to get that.
The phase of a complex number is the angle that the number makes with the positive real axis on a complex(Imaginary vs real) plot. 

Since the coefficients are given by $$a=A \frac{\sin(n\pi/2)}{n\pi/2}$$ it can be seen that it is a real number for any value of n. So $a$ will have a phase of either 0 (for positive number) or $\pi$ (for negative number). Hence whenever the value of $a$ becomes negative the phase is $\pi$.