Is the green polyline straight (I suppose not)?
If it isn't, what is the average based on?
Maybe you mean average according to the x-axis? I see that your distance line is vertical, so that suggests to base it on the x-axis
Can these two ever intersect?
Is the green polyline always bigger than the blue one (both to the left and to the right)?