xIntercept property

double get xIntercept

Get the x-intercept of this line

Returns double.nan for horizontal lines (undefined x-intercept).

Implementation

double get xIntercept {
  final dy = b.y - a.y;
  if (dy == 0) return double.nan;
  return a.x - a.y / slope;
}