factor out mode-dependent real trig functions

Exact value checks also need to be performed in the ->R function
that converts polar to rectangular coordinates.
adjust sign of real part of result of complex arctan