Creates a LineSegment by defining its two endpoints.
LineSegment({required this.p1, required this.p2});