blob: 7741695a7eddfbcf821b4abe55c5526ebbbefaca (
plain)
| 1
2
3
4
5
6
 | #!/bin/sh
# InterpoLation
# y=?, x=$1, xa=$2, xb=$3, ya=$4, yb=$5, scale=$6
# https://en.wikipedia.org/wiki/Interpolation#Linear_interpolation
echo "scale=${6:-4};$4+($5-$4)*($1-$2)/($3-$2)" | bc
 |