Phasor Estiamation with DFT algoridhm

Your a[] waveform and your sin/cos frequency are different, so you're not going to see
anything meaningful, especially as you're not using a sample window function like Blackman or Hanning.

You can only resolve at the same frequency as the signal.

And this is not really a DFT, the transform converts time-domain to frequency-domain
keeping all the information, here you are picking out one complex frequency component.