slope method

double? slope()

Implementation

double? slope() {
  final x1 = a.x;
  final y1 = a.y;
  final x2 = b.x;
  final y2 = b.y;

  if (x1 == x2) return null;
  return (y1 - y2) / (x1 - x2);
}