If you know your location, and the intersection point it would just be the distance forumla again distance(intersection.x,intersection.y,you.x,you.y)
If what you're saying is that you want a height value for any arbitrary point on the line. You could use lerp, and the gett function of the math plugin so it'd be
Lerp(minheight,maxheight,math.gett(green.x,red.x,arbitrarypoint.x))
If greenx and redx are equal, you'd use y values.
If you're one of those plugin shy people, the formula for math.gett is just
Gett(a,b,x)
Answer=(x-a)/(b-a)