Yello!
While developing some functions to rotate entites around I encountered a Problem with the fatan function. I suspected this to be the atan2 function, which is an extended version of the tan function, however fatan does merely return values of atan(y/x) if x!= 0 and 0 otherwise.
for anyone who is interested there is a simple way to circumvnt this limitation:
Code:
function atan2(y, x)
{
if(x>0) {
return(fatan(y,x));
} else {
if(x<0) {
return(fatan(y,x)+180);
} else {
return(sign(y)*90);
}}}
}
I was just wondering if fatanīs behaviour is intended. Took me a few hours to catch that one...
profmakx / REVOgames