MATLAB: Find intersection between horizontal line and a set of (x,y) data and find the length of intersected line segments above the given (x,y) data

indexinginterpolationMATLAB

I have a river cross section data as a set of (x,y) points.
I have to find the width of the water surface for given water level elevation.
For example, the river cross section data joined with straight lines (red line) is as shown in the attached image and blue line is the given water surface elevation.
The water surface elevation intersects the cross section at four points here (it could be any number ranging from 2 to n)
What i need to do is to find the lengths of the intersected line segments representing water surface which are above the cross section.
Need some quick ideas.
Related Question