summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohannes Hofmann <Johannes.Hofmann@gmx.de>2006-12-12 19:19:00 +0100
committerJohannes Hofmann <Johannes.Hofmann@gmx.de>2006-12-12 19:19:00 +0100
commite4bf7c9dec362739678689d87126c8df490ddb08 (patch)
tree075097be5bcc4c8258edfeeb8131d0a75d31807e /src
parentecf37e45b96cae7596edffbe5b381ba123bc5c5f (diff)
try to get display working
Diffstat (limited to 'src')
-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)"$