From 3593693771e4ea67334e5dc0445bc47179ac8248 Mon Sep 17 00:00:00 2001 From: Johannes Hofmann Date: Tue, 12 Dec 2006 17:32:22 +0100 Subject: lsq_funcs.max -> lsq_funcs.mac --- src/Makefile.lsq_funcs | 2 +- src/lsq_funcs.mac | 28 ++++++++++++++++++++++++++++ src/lsq_funcs.max | 28 ---------------------------- 3 files changed, 29 insertions(+), 29 deletions(-) create mode 100644 src/lsq_funcs.mac delete mode 100644 src/lsq_funcs.max (limited to 'src') diff --git a/src/Makefile.lsq_funcs b/src/Makefile.lsq_funcs index bbac7f7..e573323 100644 --- a/src/Makefile.lsq_funcs +++ b/src/Makefile.lsq_funcs @@ -1,4 +1,4 @@ all: lsq_funcs.c lsq_funcs.c: lsq_funcs.max - maxima -b lsq_funcs.max | grep "^mac_" > lsq_funcs.c + maxima -b lsq_funcs.mac | grep "^mac_" > lsq_funcs.c diff --git a/src/lsq_funcs.mac b/src/lsq_funcs.mac new file mode 100644 index 0000000..671aae2 --- /dev/null +++ b/src/lsq_funcs.mac @@ -0,0 +1,28 @@ +/* + * This is the basic pinhole projection model with distortion correction + */ +x_undist_unrot : tan(m_view - c_view) * scale$ +y_undist_unrot : tan(m_nick - c_nick) * scale$ +d : y_undist_unrot ^ 2 + x_undist_unrot ^ 2$ +dist_fact : d ^2 * k1 + d * k0$ +x_unrot : x_undist_unrot * dist_fact$ +y_unrot : y_undist_unrot * dist_fact$ +x : y_unrot * sin(c_tilt) + x_unrot * cos(c_tilt)$ +y : y_unrot * cos(c_tilt) - x_unrot * sin(c_tilt)$ +/* + * Some mangling for C code generation + */ +x_expand : trigexpand(x)$ +y_expand : trigexpand(y)$ +sprint("mac_x = ", string(subst(pow, "^", x_expand)))$ +sprint("mac_y = ", string(subst(pow, "^",y_expand)))$ +sprint("mac_x_dc_view = ", string(subst(pow, "^",diff(x_expand, c_view))))$ +sprint("mac_x_dc_nick = ", string(subst(pow, "^",diff(x_expand, c_nick))))$ +sprint("mac_x_dscale = ", string(subst(pow, "^",diff(x_expand, scale))))$ +sprint("mac_x_dk0 = ", string(subst(pow, "^",diff(x_expand, k0))))$ +sprint("mac_x_dk1 = ", string(subst(pow, "^",diff(x_expand, k1))))$ +sprint("mac_y_dc_view = ", string(subst(pow, "^",diff(y_expand, c_view))))$ +sprint("mac_y_dc_nick = ", string(subst(pow, "^",diff(y_expand, c_nick))))$ +sprint("mac_y_dscale = ", string(subst(pow, "^",diff(y_expand, scale))))$ +sprint("mac_y_dk0 = ", string(subst(pow, "^",diff(y_expand, k0))))$ +sprint("mac_y_dk1 = ", string(subst(pow, "^",diff(y_expand, k1))))$ diff --git a/src/lsq_funcs.max b/src/lsq_funcs.max deleted file mode 100644 index 671aae2..0000000 --- a/src/lsq_funcs.max +++ /dev/null @@ -1,28 +0,0 @@ -/* - * This is the basic pinhole projection model with distortion correction - */ -x_undist_unrot : tan(m_view - c_view) * scale$ -y_undist_unrot : tan(m_nick - c_nick) * scale$ -d : y_undist_unrot ^ 2 + x_undist_unrot ^ 2$ -dist_fact : d ^2 * k1 + d * k0$ -x_unrot : x_undist_unrot * dist_fact$ -y_unrot : y_undist_unrot * dist_fact$ -x : y_unrot * sin(c_tilt) + x_unrot * cos(c_tilt)$ -y : y_unrot * cos(c_tilt) - x_unrot * sin(c_tilt)$ -/* - * Some mangling for C code generation - */ -x_expand : trigexpand(x)$ -y_expand : trigexpand(y)$ -sprint("mac_x = ", string(subst(pow, "^", x_expand)))$ -sprint("mac_y = ", string(subst(pow, "^",y_expand)))$ -sprint("mac_x_dc_view = ", string(subst(pow, "^",diff(x_expand, c_view))))$ -sprint("mac_x_dc_nick = ", string(subst(pow, "^",diff(x_expand, c_nick))))$ -sprint("mac_x_dscale = ", string(subst(pow, "^",diff(x_expand, scale))))$ -sprint("mac_x_dk0 = ", string(subst(pow, "^",diff(x_expand, k0))))$ -sprint("mac_x_dk1 = ", string(subst(pow, "^",diff(x_expand, k1))))$ -sprint("mac_y_dc_view = ", string(subst(pow, "^",diff(y_expand, c_view))))$ -sprint("mac_y_dc_nick = ", string(subst(pow, "^",diff(y_expand, c_nick))))$ -sprint("mac_y_dscale = ", string(subst(pow, "^",diff(y_expand, scale))))$ -sprint("mac_y_dk0 = ", string(subst(pow, "^",diff(y_expand, k0))))$ -sprint("mac_y_dk1 = ", string(subst(pow, "^",diff(y_expand, k1))))$ -- cgit v1.2.3