I know.

Obviously I'm having a few problems executing that for cos(x) = 0 because I don't know what Quadrants to do it for, as I stated.