Distance between two points

From Director Online Wiki
Jump to: navigation, search

This will calculate the distance between two points using the vector function distanceTo()

on distanceBetweenPoints(pt1, pt2)
  return vector(pt1[1], pt1[2], 0).distanceTo(vector(pt2[1], pt2[2], 0))
end