aboutsummaryrefslogtreecommitdiff
path: root/sbsi
diff options
context:
space:
mode:
authorrodri <rgl@antares-labs.eu>2021-06-30 19:30:06 +0000
committerrodri <rgl@antares-labs.eu>2021-06-30 19:30:06 +0000
commit3f2f92a1f48783f10692ae2defaf57585805b704 (patch)
tree59bd4e6e021ac032047b6e0ad37b813b6f5ce3ba /sbsi
parent3d91cb5bef0305ac05d3a172aecb0d60a5a2c500 (diff)
downloadrcfitness-3f2f92a1f48783f10692ae2defaf57585805b704.tar.gz
rcfitness-3f2f92a1f48783f10692ae2defaf57585805b704.tar.bz2
rcfitness-3f2f92a1f48783f10692ae2defaf57585805b704.zip
workout: ignore shell-style comments from input when adding reps per exercise.
default.session: updated program. exercises: some corrections and new stuff. added new scripts to register age, height, Δweight/dt, BSA and SBSI (the latter too technical to be useful for me but were fun rc practice.)
Diffstat (limited to 'sbsi')
-rwxr-xr-xsbsi33
1 files changed, 33 insertions, 0 deletions
diff --git a/sbsi b/sbsi
new file mode 100755
index 0000000..beb4c58
--- /dev/null
+++ b/sbsi
@@ -0,0 +1,33 @@
+#!/bin/rc
+#
+# Surface-based Body Shape Index (SBSI)
+# H(cm)^7/4 * WC(cm)^5/6
+# SBSI = ------------------------
+# BSA(m²) * VTC(cm)
+# where WC is waist circumference and VTC is the vertical trunk one.
+#
+rfork ne
+vtc=()
+wc=()
+w=()
+h=()
+flagfmt=''
+args='vtc wc weight height'
+
+fn usage {
+ aux/usage
+ exit usage
+}
+
+if(! ifs=() eval `{aux/getflags $*} || ! ~ $#* 4)
+ usage
+
+vtc=$1
+wc=$2
+w=$3
+h=$4
+bsa=`{bsa $w $h}
+
+hoc <<EOF
+($h ^ (7/4) * $wc ^ (5/6))/($bsa * $vtc)
+EOF