From d98e0c7977a5872bf3f32926b75ef7df14090b7e Mon Sep 17 00:00:00 2001 From: Johannes Hofmann Date: Wed, 21 May 2008 20:35:29 +0200 Subject: add comments --- src/lsq_rectilinear.mac | 23 ++++++----------------- 1 file changed, 6 insertions(+), 17 deletions(-) diff --git a/src/lsq_rectilinear.mac b/src/lsq_rectilinear.mac index bd0a4f9..cea35e1 100644 --- a/src/lsq_rectilinear.mac +++ b/src/lsq_rectilinear.mac @@ -2,39 +2,28 @@ * rectilinear (pinhole) projection model with distortion correction */ -c_x : cos(m_nick) * cos(m_view-c_view)$ -c_y : cos(m_nick) * sin(m_view-c_view)$ +/* switch to cartesian coordinates for nick rotation */ +c_x : cos(m_nick) * cos(m_view - c_view)$ +c_y : cos(m_nick) * sin(m_view - c_view)$ c_z : sin(m_nick)$ -/* -c_x_rot1 : cos(c_view) * c_x - sin(c_view) * c_y$ -c_y_rot1 : sin(c_view) * c_x + cos(c_view) * c_y$ -c_z_rot1 : c_z$ - -c_x_rot2 : c_x_rot1$ -c_y_rot2 : cos(c_nick) * c_y_rot1 - sin(c_nick) * c_z_rot1$ -c_z_rot2 : sin(c_nick) * c_y_rot1 - cos(c_nick) * c_z_rot1$ -*/ - c_x_rot : cos(c_nick) * c_x$ + sin(c_nick) * c_z$ c_y_rot : c_y$ c_z_rot : -sin(c_nick) * c_x + cos(c_nick) * c_z$ +/* back to spheric coordinates */ a_h : (\pi/2 - acos(c_z_rot))$ a_v : atan(c_y_rot / c_x_rot)$ - /* angle over horizon in view direction */ a_h_dir : atan (tan (a_h) * sqrt(tan(a_v) ^2 + 1))$ -/* adjust angle according to nick value */ -/* a_v : atan(cos(c_nick - a_h ) * tan((m_view - c_view) / cos(a_h)))$ */ -/* a_v : m_view - c_view$ */ - x : tan(a_v)$ y : tan(-a_h_dir)$ x_rot : y * sin(c_tilt) + x * cos(c_tilt)+x0$ y_rot : y * cos(c_tilt) - x * sin(c_tilt)$ + +/* distortion correction */ d : x_rot ^ 2 + y_rot ^ 2$ dist_fact : d ^ 2 * k1 + d * k0$ x_dist : x_rot * (1 + dist_fact) * scale$ -- cgit v1.2.3