#includeTLine line(0, 0, 1, 1); // x1, y1, x2, y2
#includeTLine line1(0, 0, 1, 1); TLine line2(1, 0, 2, 1); if (line1.Intersect(line2)) cout << "Lines intersect at (" << line1.GetXinter() << ", " << line1.GetYinter() << ")" << endl; else cout << "Lines don't intersect" << endl;
#includeThis gets the slope of the line using the `GetSlope()` method. Overall, TLine is a useful class for manipulating lines in a 2D space and is part of the ROOT package library.TLine line(0, 0, 1, 1); double slope = line.GetSlope(); cout << "Slope of line is " << slope << endl;