isPointBelongToLineSegment method Null safety
Check if a point is belonged to the segment
Implementation
static bool isPointBelongToLineSegment(Point point, Line line) {
final ac = point.distanceTo(line.p1);
final bc = point.distanceTo(line.p2);
final ab = line.p1.distanceTo(line.p2);
return ac + bc == ab;
}