summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Panorama.cxx3
-rw-r--r--src/ProjectionTangentialLSQ.cxx11
-rw-r--r--src/lsq_funcs.mac4
3 files changed, 8 insertions, 10 deletions
diff --git a/src/Panorama.cxx b/src/Panorama.cxx
index 4ecf2f4..6ed8486 100644
--- a/src/Panorama.cxx
+++ b/src/Panorama.cxx
@@ -11,6 +11,7 @@
#include "Panorama.H"
#include "ProjectionTangential.H"
+#include "ProjectionTangentialLSQ.H"
#include "ProjectionSphaeric.H"
#define EARTH_RADIUS 6371010.0
@@ -285,7 +286,7 @@ Panorama::set_projection(Projection::Projection_t p) {
switch(projection_type) {
case Projection::TANGENTIAL:
- proj = new ProjectionTangential();
+ proj = new ProjectionTangentialLSQ();
view_angle = pi_d / 3.0;
break;
case Projection::SPHAERIC:
diff --git a/src/ProjectionTangentialLSQ.cxx b/src/ProjectionTangentialLSQ.cxx
index 6ae7757..a05c990 100644
--- a/src/ProjectionTangentialLSQ.cxx
+++ b/src/ProjectionTangentialLSQ.cxx
@@ -18,6 +18,8 @@ static double sec(double a) {
#include "lsq_funcs.c"
+static double k0 = 1.0, k1 = 0.0;
+
static double
comp_tilt(double tan_nick_view, double tan_dir_view, double n_scale,
double tan_nick_m, double tan_dir_m,
@@ -143,14 +145,9 @@ ProjectionTangentialLSQ::optimize(const Hill *m1, const Hill *m2, ViewParams *pa
void
ProjectionTangentialLSQ::get_coordinates(double a_view, double a_nick,
const ViewParams *parms, double *x, double *y) {
- double x_tmp, y_tmp;
-
- x_tmp = tan(a_view) * parms->scale;
- y_tmp = - (tan(a_nick - parms->a_nick) * parms->scale);
- // rotate by a_tilt;
- *x = x_tmp * cos(parms->a_tilt) - y_tmp * sin(parms->a_tilt);
- *y = x_tmp * sin(parms->a_tilt) + y_tmp * cos(parms->a_tilt);
+ *x = mac_x(parms->a_center, parms->a_nick, parms->a_tilt, parms->scale, k0, k1, a_view, -a_nick);
+ *y = mac_y(parms->a_center, parms->a_nick, parms->a_tilt, parms->scale, k0, k1, a_view, -a_nick);
}
double
diff --git a/src/lsq_funcs.mac b/src/lsq_funcs.mac
index 3e1bc18..31f500b 100644
--- a/src/lsq_funcs.mac
+++ b/src/lsq_funcs.mac
@@ -12,8 +12,8 @@ y : y_unrot * cos(c_tilt) - x_unrot * sin(c_tilt)$
/*
* Some mangling for C code generation
*/
-x_expand : trigexpand(x)$
-y_expand : trigexpand(y)$
+x_expand : trigexpand(x_unrot)$
+y_expand : trigexpand(y_unrot)$
args: "(double c_view, double c_nick, double c_tilt, double scale, double k0, double k1, double m_view, double m_nick)"$