Hey infraRed.

There is probably a simpler way but one suggestion I have is to use complex numbers. cos(x) = [e^(ix) + e^(-ix)]/2 and sin(x) = [e^(ix) - e^(-ix)]/2i.

Given that you probably haven't done a lot of stuff like that can you mention the identities and concepts that you have studied in the course that you are taking?