Calculate angle from point to point
#2

Its some trigonometry combined with patience when finding out the right system for sa-mp. I got this somewhere in some script, it should do the job.

pawn Код:
// arctan with x/y offset of the points
new Float:angle = atan2(x1 - x2, y1 - y2);
// angle of point 1
angle += rot1;
// correction
if(angle > 360.0) angle -= 360.0;
Reply


Messages In This Thread
Calculate angle from point to point - by Thomas. - 27.11.2011, 18:30
Re: Calculate angle from point to point - by Mauzen - 27.11.2011, 20:11
Re: Calculate angle from point to point - by Thomas. - 27.11.2011, 23:55
Re: Calculate angle from point to point - by RepzThat - 28.11.2011, 01:22

Forum Jump:


Users browsing this thread: 1 Guest(s)