[Marble-commits] KDE/kdeedu/marble/src/lib/Projections

Bernhard Beschow bbeschow at cs.tu-berlin.de
Wed Sep 1 13:34:35 CEST 2010


SVN commit 1170545 by beschow:

simplify SphericalProjection::geoCoordinates(), part 2

* centerX and centerY replaced by qx and qy

 M  +3 -5      SphericalProjection.cpp  


--- trunk/KDE/kdeedu/marble/src/lib/Projections/SphericalProjection.cpp #1170544:1170545
@@ -197,12 +197,10 @@
     const qreal  inverseRadius = 1.0 / (qreal)(viewport->radius());
     bool          noerr         = false;
 
-    qreal centerX = +(qreal)( x - viewport->width()  / 2 ) * inverseRadius;
-    qreal centerY = -(qreal)( y - viewport->height() / 2 ) * inverseRadius;
+    const qreal qx = +(qreal)( x - viewport->width()  / 2 ) * inverseRadius;
+    const qreal qy = -(qreal)( y - viewport->height() / 2 ) * inverseRadius;
 
-    if ( 1 > centerX * centerX + centerY * centerY ) {
-        qreal qx = centerX;
-        qreal qy = centerY;
+    if ( 1 > qx * qx + qy * qy ) {
         qreal qr = 1.0 - qy * qy;
 
         qreal qr2z = qr - qx * qx;


More information about the Marble-commits mailing list