:WHAP: Duh
Code:
unsigned int GetAngle(signed int X, signed int Y)
{
signed int Angle = arctan(Y/abs(X));
unsigned char OtherSide = IsNegetive(X);
unsigned int Value = 0;
if (OtherSide)
Value = 180 - Angle + 360;
else
Value = Angle + 360;
Value %= 360;
return Value;
}
Unfortunately, you have to use a float for Angle because angles between -45 and 45 are as important as the others. I suppose I could flip X and Y around for that.
[Changed that tan to arctan]