Hello, I have a problem that I so far haven't been able to solve, I know it includes geometry but I need to find a way to solve it looking at it as functions, a system of linear equations or such that might be solved in a matrix. I want to find out if a line( finite) is either inside or intersecting a trapezoid. I know that the line can never be intersecting the trapezoid twice and the line is always parallel to the parallel lines of the trapezoid. I have tried to find an approach using a parametrized equation of the plane and line intersection but I dont think it covers all cases.

( something like this ( from wikipedia) : la+(lb+la)t=p0+(p1-p0)u+(p2-p0)v

thanks