yIntercept property

double get yIntercept

Get the y-intercept of this line

Returns double.nan for vertical lines (undefined y-intercept).

Implementation

double get yIntercept {
  final dx = b.x - a.x;
  if (dx == 0) return double.nan;
  return a.y - slope * a.x;
}