magnitude method

double magnitude()

Returns the length of line

Implementation

double magnitude() {
  final diff = to - from;
  final dx = diff.dx;
  final dy = diff.dy;
  return math.sqrt(dx * dx + dy * dy);
}