I always have trouble remembering these, here's a simple derivation using Euler's formula:
Note that the imaginary and real parts are separate so the line , which is real, corresponds to on the top line.