Distance between two points
#2

pawn Код:
stock Float:Distance2D(Float:x1, Float:y1, Float:x2, Float:y2, bool:sqrt = true)
{
  x1 -= x2;
  x1 *= x1;

  y1 -= y2;
  y1 *= y1;

  x1 += y1;

  return sqrt ? floatsqroot(x1) : x1;
}
pawn Код:
new Float:distance = Distance2D(-2545.3506, -474.8006, 595.0517, 2698.5789);
Reply


Messages In This Thread
Distance between two points - by NtCat - 27.04.2009, 14:24
Re: Distance between two points - by yom - 27.04.2009, 16:51
Re: Distance between two points - by Weirdosport - 27.04.2009, 17:32

Forum Jump:


Users browsing this thread: 1 Guest(s)