distanceToPoint method

double distanceToPoint(
  1. Vector2 p
)

Implementation

double distanceToPoint(vm.Vector2 p) {
  final d = (b.x - a.x) * (p.y - a.y) - (b.y - a.y) * (p.x - a.x);

  return d.sign * sqrt(d.abs());
}