distance static method

dynamic distance(
  1. Vector2 p1,
  2. Vector2 p2
)

Compute distance between two point.

计算两点间的距离。

Implementation

static distance(Vector2 p1, Vector2 p2) {
  return (p1 - p2).length;
}