[Marble-commits] KDE/kdeedu/marble/src/lib/Projections
Bernhard Beschow
bbeschow at cs.tu-berlin.de
Wed Sep 1 13:34:38 CEST 2010
SVN commit 1170547 by beschow:
simplify SphericalProjection::geoCoordinates(), part 4
* eliminate noerr variable
M +5 -6 SphericalProjection.cpp
--- trunk/KDE/kdeedu/marble/src/lib/Projections/SphericalProjection.cpp #1170546:1170547
@@ -195,27 +195,26 @@
GeoDataCoordinates::Unit unit )
{
const qreal inverseRadius = 1.0 / (qreal)(viewport->radius());
- bool noerr = false;
const qreal qx = +(qreal)( x - viewport->width() / 2 ) * inverseRadius;
const qreal qy = -(qreal)( y - viewport->height() / 2 ) * inverseRadius;
- if ( 1 > qx * qx + qy * qy ) {
+ if ( 1 <= qx * qx + qy * qy ) {
+ return false;
+ }
+
const qreal qz = sqrt( 1 - qx * qx - qy * qy );
Quaternion qpos( 0.0, qx, qy, qz );
qpos.rotateAroundAxis( viewport->planetAxis() );
qpos.getSpherical( lon, lat );
- noerr = true;
- }
-
if ( unit == GeoDataCoordinates::Degree ) {
lon *= RAD2DEG;
lat *= RAD2DEG;
}
- return noerr;
+ return true;
}
GeoDataLatLonAltBox SphericalProjection::latLonAltBox( const QRect& screenRect,
More information about the Marble-commits
mailing list