From 898f9b87858bf54d49c0ef6db57341b9ae90bb28 Mon Sep 17 00:00:00 2001 From: Xiao Pan Date: Tue, 12 Nov 2024 14:32:52 -0800 Subject: il option to input scale and better comment about usage --- sh/il | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sh') diff --git a/sh/il b/sh/il index 7c75a71..7741695 100755 --- a/sh/il +++ b/sh/il @@ -1,6 +1,6 @@ #!/bin/sh # InterpoLation -# x=$1, xa=$2, xb=$3, ya=$4, yb=$5 +# y=?, x=$1, xa=$2, xb=$3, ya=$4, yb=$5, scale=$6 # https://en.wikipedia.org/wiki/Interpolation#Linear_interpolation -echo "scale=4;$4+($5-$4)*($1-$2)/($3-$2)" | bc +echo "scale=${6:-4};$4+($5-$4)*($1-$2)/($3-$2)" | bc -- cgit v1.2.3-70-g09d2