From 4f544f1ab0d04a4b18fac5e9bec0e869b981f038 Mon Sep 17 00:00:00 2001 From: Johannes Hofmann Date: Wed, 21 May 2008 19:58:47 +0200 Subject: fixes to cartesian rotation --- src/Stitch.cxx | 2 +- src/lsq_rectilinear.mac | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/Stitch.cxx b/src/Stitch.cxx index aa3798b..e4f3d60 100644 --- a/src/Stitch.cxx +++ b/src/Stitch.cxx @@ -109,7 +109,7 @@ Stitch::resample(GipfelWidget::sample_mode_t m, } for (int y = 0; y < h; y++) { - double a_nick = (double)20.0 - y * step_view; + double a_nick = atan((double)(y_off - y)/radius); for (int x = 0; x < w; x++) { double a_view; diff --git a/src/lsq_rectilinear.mac b/src/lsq_rectilinear.mac index e439d09..bd0a4f9 100644 --- a/src/lsq_rectilinear.mac +++ b/src/lsq_rectilinear.mac @@ -14,25 +14,25 @@ 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_rot2 : cos(c_nick) * c_x_rot1$ + sin(c_nick) * c_z_rot1$ -c_y_rot2 : c_y_rot1$ -c_z_rot2 : -sin(c_nick) * c_x_rot1 + cos(c_nick) * c_z_rot1$ */ -a_h : c_nick - (\pi/2 - acos(c_z))$ -a_v : atan(c_y / c_x)$ +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$ + +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 : atan (tan (m_nick) * sqrt(tan(m_view - c_view) ^2 + 1))$ */ +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)$ +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)$ d : x_rot ^ 2 + y_rot ^ 2$ -- cgit v1.2.3