In data transmission, IQ modulation is frequently used to generate FM, AM, PSK, and other modulated signals. I is a "in phase" signal. It's a sinewave with a given frequency. Q is "quadrature" and is another sinusoid with the same frequency 90° out of phase.
Any linear combination of I and Q is a sinusoid with the same frequency. It's amplitude can be calculated using Pythagoras.
Is there a way to calculate the phase of this new sinusoid? I know i can calculate the phase with the arctan(Q/I), but because of the properties of the tangens or arctan this only works when bot phasors I and Q are both in the right half plane on a phasor diagram? Otherwise the result is 180° out of phase? Or is the only way to state this to say that you should add 180° to the result if the amplitude of I is negative?
The "atan2" answer provided in a comment is perfectly valid.
Another classical way is to use complex entities.
If the signal transmitted is
$$ x(t) = a(t) \, \cos(w t) - b(t) \, \sin(w t)$$
then, by defining $c(t) = a(t) + j \, b(t)$ we get $$x(t) = Re(z(t)) = Re( c(t) \, e^{jwt}) $$
Then, the phase you are looking for is simply the argument of $z(t)$ $$\phi = \arg(z(t)) $$
Note: $c(t)$ is the complex enveloppe.