19.02.2013, 13:20
How I can get rotation angle in degrees in pawn using atan2? I tried this:
But got this result:
-979055680
And tried this:
And here is result:
-1029692736
I also tried those codes in Java programming language, and it worked perfect, but here in pawn it's wrong. Where could be the problem?
pawn Code:
forward getAngleBetween(Float:x1, Float:y1, Float:x2, Float:y2);
public getAngleBetween(Float:x1, Float:y1, Float:x2, Float:y2){
new Float:angle = atan2(y1-y2, x1-x2) * 57.2957795;
return angle;
}
-979055680
And tried this:
pawn Code:
forward getAngleBetween(Float:x1, Float:y1, Float:x2, Float:y2);
public getAngleBetween(Float:x1, Float:y1, Float:x2, Float:y2){
new Float:angle = atan2(y2-y1, x2-x1);
return angle;
}
-1029692736
I also tried those codes in Java programming language, and it worked perfect, but here in pawn it's wrong. Where could be the problem?