If the x component is negative (which I guess I can get rid of yRand because it can be either positive or negative) then the angle will be off by pi so I want to add pi to the resulting angle to fix it.
No, it is not deleted. it is not stored anywhere.
What you doing is essentually this: 7 += 3;
You should assign resul of atan to a value first.
Like: double x = atan2(xRand,yRand);
Actually you are gerring wrong result here: it is atan2(yRand, xRand)
Yoiu can do something like: