From fbb4796e81dcb2dc2bcf792917f2391f799653c8 Mon Sep 17 00:00:00 2001 From: Johannes Hofmann Date: Thu, 14 Dec 2006 18:58:35 +0100 Subject: works quite well now --- src/ProjectionTangentialLSQ.cxx | 9 ++++++--- src/lsq_funcs.mac | 10 +++++----- 2 files changed, 11 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/ProjectionTangentialLSQ.cxx b/src/ProjectionTangentialLSQ.cxx index b2f7d38..8c48105 100644 --- a/src/ProjectionTangentialLSQ.cxx +++ b/src/ProjectionTangentialLSQ.cxx @@ -65,13 +65,13 @@ ProjectionTangentialLSQ::comp_params(const Hills *h, ViewParams *parms) { parms->a_center = a_center_tmp; parms->scale = scale_tmp; parms->a_nick = a_nick_tmp; - - lsq(h, parms); - if (angle_dist(parms->a_center, m1->alph) > pi_d/2.0) { parms->a_center = parms->a_center + pi_d; } + + lsq(h, parms); + return 0; } } @@ -205,6 +205,9 @@ ProjectionTangentialLSQ::lsq(const Hills *h, ViewParams *parms) { status = gsl_multifit_fdfsolver_iterate (s); fprintf(stderr, "gsl_multifit_fdfsolver_iterate: status %d\n", status); + if (status) { + break; + } } diff --git a/src/lsq_funcs.mac b/src/lsq_funcs.mac index 0056185..d57008e 100644 --- a/src/lsq_funcs.mac +++ b/src/lsq_funcs.mac @@ -2,14 +2,14 @@ * This is the basic pinhole projection model with distortion correction */ -x_undist_unrot : tan(m_view - c_view) * scale$ -y_undist_unrot : tan(c_nick - m_nick) * scale$ +x_undist_unrot : tan(m_view - c_view) $ +y_undist_unrot : tan(c_nick - m_nick) $ d : y_undist_unrot ^ 2 + x_undist_unrot ^ 2$ -dist_fact : d ^2 * k1 + d * k0$ +dist_fact : d ^ 2 * k1 + d * k0$ x_unrot : x_undist_unrot * (1 + dist_fact)$ y_unrot : y_undist_unrot * (1 + 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 : scale * (y_unrot * sin(c_tilt) + x_unrot * cos(c_tilt))$ +y : scale * (y_unrot * cos(c_tilt) - x_unrot * sin(c_tilt))$ /* * Some mangling for C code generation -- cgit v1.2.3