perpendicularThroughPoint static method

Line perpendicularThroughPoint(
  1. Line line,
  2. Point point
)

Implementation

static Line perpendicularThroughPoint(Line line, Point point) {
  var slope = -1 / line.slope;
  var intercept = point.y - slope * point.x;
  return Line(slope: slope, intercept: intercept);
}