function yAtLine(x,x1,x2,y1,y2: real): Real; var y: real; Begin Result := ((x-x1)/(x2-x1))*(y2-y1)+y1; End;