intersect method

Coord? intersect(
  1. Line line, [
  2. num errorTolerance = kDefaultError
])

Returns null if lines are parallel

Implementation

Coord? intersect(Line line, [num errorTolerance = kDefaultError]) {
  final denominator = ((slope.a * line.slope.b) - (slope.b * line.slope.a));
  if (denominator.abs() <= errorTolerance) return null;
  final x = ((line.c * slope.b) - (line.slope.b * c)) / denominator;
  final y = ((c * line.slope.a) - (slope.a * line.c)) / denominator;
  return (x, y);
}