wardley.love/0055-y_at_x

8 lines
231 B
Plaintext

y_at_x = function(startx,starty, endx,endy, x)
-- y at a given x on a line
-- Could be nil when the line is parallel to the y axis.
if startx == endx then
return
end
return (endy-starty)/(endx-startx)*(x-startx) + starty
end