The very first time I needed to find an intersection between two lines, I used the LineLineIntersection from the Building Coder Samples Util.cs.

I didn’t understand at the time that I could use this overload of the Intersect method - I hadn’t used the out keyword in C# until that point, and at that time I couldn’t wrap my head around the idea that something that looks like an argument given to a method could store results calculated with that method.

The way I finally understood the concept was by reading this example in Python. Then I went into the Revit SDK Samples and found a utility method called GetIntersection for getting the intersection between two lines (the first one of the array) - a simple C# working example.