summaryrefslogtreecommitdiff
path: root/src/lsq_rectilinear.mac
diff options
context:
space:
mode:
Diffstat (limited to 'src/lsq_rectilinear.mac')
-rw-r--r--src/lsq_rectilinear.mac9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/lsq_rectilinear.mac b/src/lsq_rectilinear.mac
index d1abf4e..a06670d 100644
--- a/src/lsq_rectilinear.mac
+++ b/src/lsq_rectilinear.mac
@@ -2,11 +2,14 @@
* rectilinear (pinhole) projection model with distortion correction
*/
-a_v : m_view - c_view$
-a_h : c_nick - atan (tan (m_nick) / cos(a_v))$
+/* angle over horizon in view direction */
+a_h : atan (tan (m_nick) / cos(m_view - c_view))$
+
+/* adjust angle according to nick value */
+a_v : atan(cos(c_nick + a_h) * tan(m_view - c_view) / cos(a_h))$
x : tan(a_v)$
-y : tan(a_h)$
+y : tan(c_nick - a_h)$
x_rot : y * sin(c_tilt) + x * cos(c_tilt)+x0$
y_rot : y * cos(c_tilt) - x * sin(c_tilt)$
d : x_rot ^ 2 + y_rot ^ 2$