summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/lsq_funcs.max12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/lsq_funcs.max b/src/lsq_funcs.max
new file mode 100644
index 0000000..8875a4e
--- /dev/null
+++ b/src/lsq_funcs.max
@@ -0,0 +1,12 @@
+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)$
+x_expand : trigexpand(x)$
+y_expand : trigexpand(y)$
+SPRINT("out_x = ", STRING(DIFF(x_expand, TAN(c_view))))$
+