linearInterp

Linear Interpolation between two points. (x1,y1) is the leftmost point and (x2,y2) is the rightmost point. x is some number between x1 and x2. Returns the corresopnding y value for x such that (x,y) is a point on the line that intersects (x1,y1) and (x2,y2)

nothrow @nogc
T
linearInterp
(
T = float
)
(
T x1
,
T x2
,
T y1
,
T y2
,
T x
)

Meta