If I interpret your graph correctly, then this is just the Pythagorean theorem
Where a and b are the length and height your right triangle, and c is the hypotenuse.
So your example, is 8 units long and 1.6 units high (4.6-3)
If that is the case, I would find the slope of the hypotenuse by dividing the y value by the x value:
Find the distance from the angle to the line
Multiply the slope by the distance to find the height off of the base of the triangle
Add the distance from the base of the shape to the base of the triangle (this is given in the picture as 3)
And so the height of the line in the middle of the shape is 3.6