summaryrefslogtreecommitdiff
path: root/src/lsq_funcs.max
blob: 8875a4e137ce1dc4fb04084eaf963e40a9e9cd06 (plain)
1
2
3
4
5
6
7
8
9
10
11
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))))$