diff options
author | Johannes Hofmann <Johannes.Hofmann@gmx.de> | 2006-12-12 18:38:59 +0100 |
---|---|---|
committer | Johannes Hofmann <Johannes.Hofmann@gmx.de> | 2006-12-12 18:38:59 +0100 |
commit | f8726929e645539456bd1f5fd2a37160b10778a5 (patch) | |
tree | 3fc89a98bbf5f7c1df5f22556db842d923d4e173 | |
parent | 5ede63843485a9d6078bfe6b628c4854115368d7 (diff) |
make c-functions
-rw-r--r-- | src/Makefile.lsq_funcs | 2 | ||||
-rw-r--r-- | src/lsq_funcs.mac | 27 |
2 files changed, 16 insertions, 13 deletions
diff --git a/src/Makefile.lsq_funcs b/src/Makefile.lsq_funcs index f818dbd..2d778af 100644 --- a/src/Makefile.lsq_funcs +++ b/src/Makefile.lsq_funcs @@ -1,4 +1,4 @@ all: lsq_funcs.c lsq_funcs.c: lsq_funcs.mac - maxima -b lsq_funcs.mac | grep "^mac_" > lsq_funcs.c + maxima -b lsq_funcs.mac | grep "^double" > lsq_funcs.c diff --git a/src/lsq_funcs.mac b/src/lsq_funcs.mac index 0c7b7cd..f2a70b9 100644 --- a/src/lsq_funcs.mac +++ b/src/lsq_funcs.mac @@ -14,27 +14,30 @@ y : y_unrot * cos(c_tilt) - x_unrot * sin(c_tilt)$ */ x_expand : trigexpand(x)$ y_expand : trigexpand(y)$ -sprint("mac_x =",string(subst(pow, "^", x_expand)),";"," + +args: "(double c_view, double c_nick, double scale, double k0, double k1, double m_view, double m_nick)"$ + +sprint("double mac_x", args, "{ return",string(subst(pow, "^", x_expand)),"}"," ")$ -sprint("mac_y = ", string(subst(pow, "^",y_expand)),";"," +sprint("double mac_y", args, "{ return", string(subst(pow, "^",y_expand)),"}"," ")$ -sprint("mac_x_dc_view = ", string(subst(pow, "^",diff(x_expand, c_view))),";"," +sprint("double mac_x_dc_view", args, "{ return", string(subst(pow, "^",diff(x_expand, c_view))),"}"," ")$ -sprint("mac_x_dc_nick = ", string(subst(pow, "^",diff(x_expand, c_nick))),";"," +sprint("double mac_x_dc_nick", args, "{ return", string(subst(pow, "^",diff(x_expand, c_nick))),"}"," ")$ -sprint("mac_x_dscale = ", string(subst(pow, "^",diff(x_expand, scale))),";"," +sprint("double mac_x_dscale", args, "{ return",string(subst(pow, "^",diff(x_expand, scale))),"}"," ")$ -sprint("mac_x_dk0 = ", string(subst(pow, "^",diff(x_expand, k0))),";"," +sprint("double mac_x_dk0", args, "{ return",string(subst(pow, "^",diff(x_expand, k0))),"}"," ")$ -sprint("mac_x_dk1 = ", string(subst(pow, "^",diff(x_expand, k1))),";"," +sprint("double mac_x_dk1",args, "{ return", string(subst(pow, "^",diff(x_expand, k1))),"}"," ")$ -sprint("mac_y_dc_view = ", string(subst(pow, "^",diff(y_expand, c_view))),";"," +sprint("double mac_y_dc_view",args, "{ return", string(subst(pow, "^",diff(y_expand, c_view))),"}"," ")$ -sprint("mac_y_dc_nick = ", string(subst(pow, "^",diff(y_expand, c_nick))),";"," +sprint("double mac_y_dc_nick",args, "{ return", string(subst(pow, "^",diff(y_expand, c_nick))),"}"," ")$ -sprint("mac_y_dscale = ", string(subst(pow, "^",diff(y_expand, scale))),";"," +sprint("double mac_y_dscale", args, "{ return",string(subst(pow, "^",diff(y_expand, scale))),"}"," ")$ -sprint("mac_y_dk0 = ", string(subst(pow, "^",diff(y_expand, k0))),";"," +sprint("double mac_y_dk0", args, "{ return",string(subst(pow, "^",diff(y_expand, k0))),"}"," ")$ -sprint("mac_y_dk1 = ", string(subst(pow, "^",diff(y_expand, k1))),";"," +sprint("double mac_y_dk1",args, "{ return", string(subst(pow, "^",diff(y_expand, k1))),"}"," ")$ |