Corner constructor
Provide rect
in case the object is bounded inside a box, rect
.
Implementation
Corner(Coord? prev, this.point, Coord? next, num radius,
[Rect? rect, this.inCircle = false]) {
this.prev = prev ?? next ?? point;
this.next = next ?? prev ?? point;
final crossProduct = (point - this.prev).cross(this.next - point);
if (crossProduct == 0) {
throw ArgumentError('Given corner is a straight line');
}
clockwise = crossProduct < 0;
circle =
_circleIfPointCloseToEdge(_circleAccordingToLine(radius), radius, rect);
}