Rotation between two points
#3

Quote:
Originally Posted by Joe Staff
I've figured it out for 2D coordinates (X,Y) but not yet for 3D coordinates (X,Y,Z)

pawn Код:
Float:GetAngleBetweenPoints(Float:X1,Float:Y1,Float:X2,Float:Y2)
{
  new Float:angle=atan2(X2-X1,Y2-Y1);
  if(angle>360)angle-=360;
  if(angle<0)angle+=360;
  return angle;
}
Thanks for trying, but I think I had already stumbled across something similar in my attempts to find what I wanted.
The problem is, not only is it for two 2D points, it also only returns one angle, I'd need three.
Reply


Messages In This Thread
Rotation between two points - by ev0lution - 02.04.2010, 02:37
Re: Rotation between two points - by Joe Staff - 02.04.2010, 04:15
Re: Rotation between two points - by ev0lution - 02.04.2010, 04:17
Re: Rotation between two points - by Joe Staff - 02.04.2010, 04:19
Re: Rotation between two points - by ev0lution - 02.04.2010, 04:24
Re: Rotation between two points - by ev0lution - 02.04.2010, 22:01
Re: Rotation between two points - by ev0lution - 04.04.2010, 00:15

Forum Jump:


Users browsing this thread: 1 Guest(s)