lineInterpolate

lineInterpolate
(
T
)
(
,
float k
,
bool line_end = false
)
if (
hasBasicMathOp!T
)

Examples

1 alias InterpolateTableData!float TT;
2 auto tbl =
3     [
4     TT( 0, 10 ),
5     TT( 10, 18 ),
6     TT( 25, 20 ),
7     TT( 50, 13 ),
8     TT( 55, 25 )
9     ];
10 
11 assert( lineInterpolate( tbl, 0 ) == 10 );
12 assert( lineInterpolate( tbl, 5 ) == 14 );
13 assert( lineInterpolate( tbl, 10 ) == 18 );
14 assert( lineInterpolate( tbl, -10 ) == 10 );
15 assert( lineInterpolate( tbl, 80 ) == 25 );

Meta