Hey, I have a code that uses the atan function but I want it to be able to say what the angle is given what quadrant you are in but I keep getting an error message (title) when I do it.
This is the part of the code that is getting the error
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: