2点間の距離をもとめる

1月 22, 2007 · Posted in Flash 

概要

2点間の距離をもとめる。

Action Script
function getDistance(x1,y1,x2,y2){
  xDis = x2-x1;
  yDis = y2-y1;
  distance = Math.sqrt((xDis*xDis)+(yDis*yDis));
  return distance;
}

Comments

Comments are closed.