fromLineAndPoint static method

(Circle, Circle) fromLineAndPoint(
  1. Line line,
  2. Coord point,
  3. num radius
)

Creates 2 circles tangent to the line and passing through point, of given radius.

Note:- point should be on the line, otherwise it will take the point closest to the given point on the line.

Implementation

static (Circle, Circle) fromLineAndPoint(Line line, Coord point, num radius) {
  point = line.pointOnLineClosestTo(point);
  line = line.perpendicular(point);
  final centers = line.pointsOnLineFromPoint(point, radius);
  return (Circle(centers.$1, radius), Circle(centers.$2, radius));
}