summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohannes Hofmann <Johannes.Hofmann@gmx.de>2007-08-13 20:40:46 +0200
committerJohannes Hofmann <Johannes.Hofmann@gmx.de>2007-08-13 20:40:46 +0200
commit5dbd0df47b2e3a69a50b3d4c9d8c287a365b202b (patch)
treed452b43f5344fb45bf3def2ba19f1f5e733a32a1 /src
parent4264b89157f580bd27f7a1849b646ac80c30ed09 (diff)
parentd6948bd07f2d8dd4d41bfeb9f4dfbcfc89179eb9 (diff)
merge
Diffstat (limited to 'src')
-rw-r--r--src/ProjectionLSQ.cxx8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/ProjectionLSQ.cxx b/src/ProjectionLSQ.cxx
index 5da4369..901c721 100644
--- a/src/ProjectionLSQ.cxx
+++ b/src/ProjectionLSQ.cxx
@@ -17,6 +17,7 @@
#include "ProjectionLSQ.H"
+static double pi_d = asin(1.0) * 2.0;
ProjectionLSQ::ProjectionLSQ() {
}
@@ -236,6 +237,13 @@ void
ProjectionLSQ::get_coordinates(double alph, double a_nick,
const ViewParams *parms, double *x, double *y) {
+ // Normalize alph - parms->a_center to [-pi/2, pi/2]
+ if (alph - parms->a_center > pi_d) {
+ alph -= 2.0 * pi_d;
+ } else if (alph - parms->a_center < -pi_d) {
+ alph += 2.0 * pi_d;
+ }
+
*x = mac_x(parms->a_center, parms->a_nick, parms->a_tilt, parms->scale,
parms->k0, parms->k1, parms->x0, alph, a_nick);
*y = mac_y(parms->a_center, parms->a_nick, parms->a_tilt, parms->scale,