Skip to content
Permalink
Browse files

(q)sqrt -> std::sqrt

  • Loading branch information
nyalldawson committed Aug 24, 2017
1 parent fec03ca commit b5ca4b4ea8331e7b2c208e83d1a9971c170b01e3
Showing with 190 additions and 190 deletions.
  1. +12 −12 src/analysis/interpolation/DualEdgeTriangulation.cc
  2. +1 −1 src/analysis/interpolation/LinTriangleInterpolator.cc
  3. +16 −16 src/analysis/interpolation/MathUtils.cc
  4. +1 −1 src/analysis/interpolation/qgsidwinterpolator.cpp
  5. +1 −1 src/analysis/raster/qgshillshadefilter.cpp
  6. +1 −1 src/analysis/raster/qgskde.cpp
  7. +1 −1 src/analysis/raster/qgsrastermatrix.cpp
  8. +1 −1 src/analysis/raster/qgsslopefilter.cpp
  9. +5 −5 src/analysis/vector/qgstransectsample.cpp
  10. +1 −1 src/app/dwg/libdxfrw/drw_base.h
  11. +1 −1 src/app/dwg/libdxfrw/drw_entities.cpp
  12. +3 −3 src/app/dwg/qgsdwgimporter.cpp
  13. +1 −1 src/app/nodetool/qgsnodeeditor.cpp
  14. +3 −3 src/app/nodetool/qgsnodetool.cpp
  15. +3 −3 src/app/qgisapp.cpp
  16. +1 −1 src/app/qgsmaptoolcircularstringradius.cpp
  17. +2 −2 src/app/qgsmaptoollabel.cpp
  18. +1 −1 src/app/qgsmaptooloffsetcurve.cpp
  19. +1 −1 src/app/qgsmaptoolselectradius.cpp
  20. +1 −1 src/app/qgsmeasuredialog.cpp
  21. +1 −1 src/app/qgspointrotationitem.cpp
  22. +1 −1 src/app/qgsrastercalcdialog.cpp
  23. +2 −2 src/core/annotations/qgsannotation.cpp
  24. +1 −1 src/core/composer/qgscomposerutils.cpp
  25. +3 −3 src/core/diagram/qgsdiagram.cpp
  26. +1 −1 src/core/diagram/qgstextdiagram.cpp
  27. +3 −3 src/core/effects/qgsimageoperation.cpp
  28. +1 −1 src/core/expression/qgsexpressionfunction.cpp
  29. +2 −2 src/core/geometry/qgscircularstring.cpp
  30. +4 −4 src/core/geometry/qgsellipse.cpp
  31. +7 −7 src/core/geometry/qgsgeometryutils.cpp
  32. +1 −1 src/core/geometry/qgsinternalgeometryengine.cpp
  33. +7 −7 src/core/geometry/qgslinestring.cpp
  34. +1 −1 src/core/geometry/qgspolygon.cpp
  35. +8 −8 src/core/pal/feature.cpp
  36. +1 −1 src/core/pal/geomfunction.cpp
  37. +1 −1 src/core/pal/labelposition.cpp
  38. +2 −2 src/core/pal/pointset.cpp
  39. +1 −1 src/core/pal/rtree.hpp
  40. +1 −1 src/core/qgscoordinatetransform.cpp
  41. +2 −2 src/core/qgsdistancearea.cpp
  42. +1 −1 src/core/qgspallabeling.cpp
  43. +2 −2 src/core/qgspointlocator.cpp
  44. +1 −1 src/core/qgsscalecalculator.cpp
  45. +2 −2 src/core/qgssnappingutils.cpp
  46. +3 −3 src/core/qgstextrenderer.cpp
  47. +1 −1 src/core/qgstolerance.cpp
  48. +1 −1 src/core/qgstracer.cpp
  49. +1 −1 src/core/qgsvectorlayerlabeling.cpp
  50. +2 −2 src/core/qgsvectorlayerrenderer.cpp
  51. +1 −1 src/core/raster/qgshillshaderenderer.cpp
  52. +3 −3 src/core/raster/qgsrasterinterface.cpp
  53. +2 −2 src/core/raster/qgsrasterprojector.cpp
  54. +1 −1 src/core/simplify/effectivearea.cpp
  55. +1 −1 src/core/symbology/qgsarrowsymbollayer.cpp
  56. +3 −3 src/core/symbology/qgsfillsymbollayer.cpp
  57. +1 −1 src/core/symbology/qgsgraduatedsymbolrenderer.cpp
  58. +1 −1 src/core/symbology/qgsheatmaprenderer.cpp
  59. +5 −5 src/core/symbology/qgslinesymbollayer.cpp
  60. +5 −5 src/core/symbology/qgsmarkersymbollayer.cpp
  61. +1 −1 src/core/symbology/qgssymbollayerutils.cpp
  62. +7 −7 src/gui/qgsadvanceddigitizingdockwidget.cpp
  63. +4 −4 src/gui/qgscolorwidgets.cpp
  64. +2 −2 src/plugins/geometry_checker/checks/qgsgeometrysegmentlengthcheck.cpp
  65. +2 −2 src/plugins/geometry_checker/utils/qgsgeometrycheckerutils.cpp
  66. +1 −1 src/plugins/georeferencer/qgsgcplistmodel.cpp
  67. +2 −2 src/plugins/georeferencer/qgsgeorefplugingui.cpp
  68. +2 −2 src/plugins/georeferencer/qgsleastsquares.cpp
  69. +1 −1 src/plugins/georeferencer/qgsresidualplotitem.cpp
  70. +10 −10 src/plugins/grass/qgsgrassmapcalc.cpp
  71. +3 −3 src/plugins/topology/topolTest.cpp
  72. +1 −1 src/server/qgswmsprojectparser.cpp
  73. +1 −1 src/server/services/wms/qgswmsgetcapabilities.cpp
  74. +1 −1 tests/bench/qgsbench.cpp
  75. +3 −3 tests/src/core/testqgsgeometry.cpp
  76. +1 −1 tests/src/core/testqgsgeometryutils.cpp
  77. +1 −1 tests/src/core/testqgspoint.cpp
  78. +2 −2 tests/src/core/testqgspointlocator.cpp
@@ -1271,8 +1271,8 @@ int DualEdgeTriangulation::insertForcedSegment( int p1, int p2, bool breakline )
p3 = mHalfEdge[mHalfEdge[actedge]->getNext()]->getPoint();
p4 = mHalfEdge[mHalfEdge[mHalfEdge[actedge]->getNext()]->getDual()]->getPoint();
MathUtils::lineIntersection( mPointVector[p1], mPointVector[p2], mPointVector[p3], mPointVector[p4], &crosspoint );
double dista = sqrt( ( crosspoint.x() - mPointVector[p3]->x() ) * ( crosspoint.x() - mPointVector[p3]->x() ) + ( crosspoint.y() - mPointVector[p3]->y() ) * ( crosspoint.y() - mPointVector[p3]->y() ) );
double distb = sqrt( ( crosspoint.x() - mPointVector[p4]->x() ) * ( crosspoint.x() - mPointVector[p4]->x() ) + ( crosspoint.y() - mPointVector[p4]->y() ) * ( crosspoint.y() - mPointVector[p4]->y() ) );
double dista = std::sqrt( ( crosspoint.x() - mPointVector[p3]->x() ) * ( crosspoint.x() - mPointVector[p3]->x() ) + ( crosspoint.y() - mPointVector[p3]->y() ) * ( crosspoint.y() - mPointVector[p3]->y() ) );
double distb = std::sqrt( ( crosspoint.x() - mPointVector[p4]->x() ) * ( crosspoint.x() - mPointVector[p4]->x() ) + ( crosspoint.y() - mPointVector[p4]->y() ) * ( crosspoint.y() - mPointVector[p4]->y() ) );
if ( dista <= distb )
{
insertForcedSegment( p1, p3, breakline );
@@ -1293,8 +1293,8 @@ int DualEdgeTriangulation::insertForcedSegment( int p1, int p2, bool breakline )
p3 = mHalfEdge[mHalfEdge[actedge]->getNext()]->getPoint();
p4 = mHalfEdge[mHalfEdge[mHalfEdge[actedge]->getNext()]->getDual()]->getPoint();
MathUtils::lineIntersection( mPointVector[p1], mPointVector[p2], mPointVector[p3], mPointVector[p4], &crosspoint );
double distpart = sqrt( ( crosspoint.x() - mPointVector[p4]->x() ) * ( crosspoint.x() - mPointVector[p4]->x() ) + ( crosspoint.y() - mPointVector[p4]->y() ) * ( crosspoint.y() - mPointVector[p4]->y() ) );
double disttot = sqrt( ( mPointVector[p3]->x() - mPointVector[p4]->x() ) * ( mPointVector[p3]->x() - mPointVector[p4]->x() ) + ( mPointVector[p3]->y() - mPointVector[p4]->y() ) * ( mPointVector[p3]->y() - mPointVector[p4]->y() ) );
double distpart = std::sqrt( ( crosspoint.x() - mPointVector[p4]->x() ) * ( crosspoint.x() - mPointVector[p4]->x() ) + ( crosspoint.y() - mPointVector[p4]->y() ) * ( crosspoint.y() - mPointVector[p4]->y() ) );
double disttot = std::sqrt( ( mPointVector[p3]->x() - mPointVector[p4]->x() ) * ( mPointVector[p3]->x() - mPointVector[p4]->x() ) + ( mPointVector[p3]->y() - mPointVector[p4]->y() ) * ( mPointVector[p3]->y() - mPointVector[p4]->y() ) );
float frac = distpart / disttot;

if ( frac == 0 || frac == 1 )//just in case MathUtils::lineIntersection does not work as expected
@@ -1359,8 +1359,8 @@ int DualEdgeTriangulation::insertForcedSegment( int p1, int p2, bool breakline )
p3 = mHalfEdge[mHalfEdge[crossedEdges.last()]->getDual()]->getPoint();
p4 = mHalfEdge[mHalfEdge[mHalfEdge[crossedEdges.last()]->getDual()]->getNext()]->getPoint();
MathUtils::lineIntersection( mPointVector[p1], mPointVector[p2], mPointVector[p3], mPointVector[p4], &crosspoint );
double dista = sqrt( ( crosspoint.x() - mPointVector[p3]->x() ) * ( crosspoint.x() - mPointVector[p3]->x() ) + ( crosspoint.y() - mPointVector[p3]->y() ) * ( crosspoint.y() - mPointVector[p3]->y() ) );
double distb = sqrt( ( crosspoint.x() - mPointVector[p4]->x() ) * ( crosspoint.x() - mPointVector[p4]->x() ) + ( crosspoint.y() - mPointVector[p4]->y() ) * ( crosspoint.y() - mPointVector[p4]->y() ) );
double dista = std::sqrt( ( crosspoint.x() - mPointVector[p3]->x() ) * ( crosspoint.x() - mPointVector[p3]->x() ) + ( crosspoint.y() - mPointVector[p3]->y() ) * ( crosspoint.y() - mPointVector[p3]->y() ) );
double distb = std::sqrt( ( crosspoint.x() - mPointVector[p4]->x() ) * ( crosspoint.x() - mPointVector[p4]->x() ) + ( crosspoint.y() - mPointVector[p4]->y() ) * ( crosspoint.y() - mPointVector[p4]->y() ) );
if ( dista <= distb )
{
insertForcedSegment( p1, p3, breakline );
@@ -1381,8 +1381,8 @@ int DualEdgeTriangulation::insertForcedSegment( int p1, int p2, bool breakline )
p3 = mHalfEdge[mHalfEdge[crossedEdges.last()]->getDual()]->getPoint();
p4 = mHalfEdge[mHalfEdge[mHalfEdge[crossedEdges.last()]->getDual()]->getNext()]->getPoint();
MathUtils::lineIntersection( mPointVector[p1], mPointVector[p2], mPointVector[p3], mPointVector[p4], &crosspoint );
double distpart = sqrt( ( crosspoint.x() - mPointVector[p3]->x() ) * ( crosspoint.x() - mPointVector[p3]->x() ) + ( crosspoint.y() - mPointVector[p3]->y() ) * ( crosspoint.y() - mPointVector[p3]->y() ) );
double disttot = sqrt( ( mPointVector[p3]->x() - mPointVector[p4]->x() ) * ( mPointVector[p3]->x() - mPointVector[p4]->x() ) + ( mPointVector[p3]->y() - mPointVector[p4]->y() ) * ( mPointVector[p3]->y() - mPointVector[p4]->y() ) );
double distpart = std::sqrt( ( crosspoint.x() - mPointVector[p3]->x() ) * ( crosspoint.x() - mPointVector[p3]->x() ) + ( crosspoint.y() - mPointVector[p3]->y() ) * ( crosspoint.y() - mPointVector[p3]->y() ) );
double disttot = std::sqrt( ( mPointVector[p3]->x() - mPointVector[p4]->x() ) * ( mPointVector[p3]->x() - mPointVector[p4]->x() ) + ( mPointVector[p3]->y() - mPointVector[p4]->y() ) * ( mPointVector[p3]->y() - mPointVector[p4]->y() ) );
float frac = distpart / disttot;
if ( frac == 0 || frac == 1 )
{
@@ -1406,8 +1406,8 @@ int DualEdgeTriangulation::insertForcedSegment( int p1, int p2, bool breakline )
p3 = mHalfEdge[mHalfEdge[mHalfEdge[crossedEdges.last()]->getDual()]->getNext()]->getPoint();
p4 = mHalfEdge[mHalfEdge[mHalfEdge[mHalfEdge[crossedEdges.last()]->getDual()]->getNext()]->getNext()]->getPoint();
MathUtils::lineIntersection( mPointVector[p1], mPointVector[p2], mPointVector[p3], mPointVector[p4], &crosspoint );
double dista = sqrt( ( crosspoint.x() - mPointVector[p3]->x() ) * ( crosspoint.x() - mPointVector[p3]->x() ) + ( crosspoint.y() - mPointVector[p3]->y() ) * ( crosspoint.y() - mPointVector[p3]->y() ) );
double distb = sqrt( ( crosspoint.x() - mPointVector[p4]->x() ) * ( crosspoint.x() - mPointVector[p4]->x() ) + ( crosspoint.y() - mPointVector[p4]->y() ) * ( crosspoint.y() - mPointVector[p4]->y() ) );
double dista = std::sqrt( ( crosspoint.x() - mPointVector[p3]->x() ) * ( crosspoint.x() - mPointVector[p3]->x() ) + ( crosspoint.y() - mPointVector[p3]->y() ) * ( crosspoint.y() - mPointVector[p3]->y() ) );
double distb = std::sqrt( ( crosspoint.x() - mPointVector[p4]->x() ) * ( crosspoint.x() - mPointVector[p4]->x() ) + ( crosspoint.y() - mPointVector[p4]->y() ) * ( crosspoint.y() - mPointVector[p4]->y() ) );
if ( dista <= distb )
{
insertForcedSegment( p1, p3, breakline );
@@ -1428,8 +1428,8 @@ int DualEdgeTriangulation::insertForcedSegment( int p1, int p2, bool breakline )
p3 = mHalfEdge[mHalfEdge[mHalfEdge[crossedEdges.last()]->getDual()]->getNext()]->getPoint();
p4 = mHalfEdge[mHalfEdge[mHalfEdge[mHalfEdge[crossedEdges.last()]->getDual()]->getNext()]->getNext()]->getPoint();
MathUtils::lineIntersection( mPointVector[p1], mPointVector[p2], mPointVector[p3], mPointVector[p4], &crosspoint );
double distpart = sqrt( ( crosspoint.x() - mPointVector[p3]->x() ) * ( crosspoint.x() - mPointVector[p3]->x() ) + ( crosspoint.y() - mPointVector[p3]->y() ) * ( crosspoint.y() - mPointVector[p3]->y() ) );
double disttot = sqrt( ( mPointVector[p3]->x() - mPointVector[p4]->x() ) * ( mPointVector[p3]->x() - mPointVector[p4]->x() ) + ( mPointVector[p3]->y() - mPointVector[p4]->y() ) * ( mPointVector[p3]->y() - mPointVector[p4]->y() ) );
double distpart = std::sqrt( ( crosspoint.x() - mPointVector[p3]->x() ) * ( crosspoint.x() - mPointVector[p3]->x() ) + ( crosspoint.y() - mPointVector[p3]->y() ) * ( crosspoint.y() - mPointVector[p3]->y() ) );
double disttot = std::sqrt( ( mPointVector[p3]->x() - mPointVector[p4]->x() ) * ( mPointVector[p3]->x() - mPointVector[p4]->x() ) + ( mPointVector[p3]->y() - mPointVector[p4]->y() ) * ( mPointVector[p3]->y() - mPointVector[p4]->y() ) );
float frac = distpart / disttot;
if ( frac == 0 || frac == 1 )
{
@@ -82,7 +82,7 @@ bool LinTriangleInterpolator::calcNormVec( double x, double y, Vector3D *vec )
if ( !calcFirstDerY( x, y, &vec2 ) )
{return false;}
Vector3D vec3( vec1.getY()*vec2.getZ() - vec1.getZ()*vec2.getY(), vec1.getZ()*vec2.getX() - vec1.getX()*vec2.getZ(), vec1.getX()*vec2.getY() - vec1.getY()*vec2.getX() );//calculate vector product
double absvec3 = sqrt( vec3.getX() * vec3.getX() + vec3.getY() * vec3.getY() + vec3.getZ() * vec3.getZ() );//length of vec3
double absvec3 = std::sqrt( vec3.getX() * vec3.getX() + vec3.getY() * vec3.getY() + vec3.getZ() * vec3.getZ() );//length of vec3
vec->setX( vec3.getX() / absvec3 );//standardize vec3 and assign it to vec
vec->setY( vec3.getY() / absvec3 );
vec->setZ( vec3.getZ() / absvec3 );
@@ -119,8 +119,8 @@ bool MathUtils::circumcenter( QgsPoint *p1, QgsPoint *p2, QgsPoint *p3, QgsPoint
{
if ( p1 && p2 && p3 && result )
{
double distp1p2 = sqrt( ( p1->x() - p2->x() ) * ( p1->x() - p2->x() ) + ( p1->y() - p2->y() ) * ( p1->y() - p2->y() ) );
double distp2p3 = sqrt( ( p2->x() - p3->x() ) * ( p2->x() - p3->x() ) + ( p2->y() - p3->y() ) * ( p2->y() - p3->y() ) );
double distp1p2 = std::sqrt( ( p1->x() - p2->x() ) * ( p1->x() - p2->x() ) + ( p1->y() - p2->y() ) * ( p1->y() - p2->y() ) );
double distp2p3 = std::sqrt( ( p2->x() - p3->x() ) * ( p2->x() - p3->x() ) + ( p2->y() - p3->y() ) * ( p2->y() - p3->y() ) );
if ( distp1p2 > distp2p3 )
{
//swap p1 and p3 to avoid round-off errors
@@ -142,9 +142,9 @@ bool MathUtils::circumcenter( QgsPoint *p1, QgsPoint *p2, QgsPoint *p3, QgsPoint

#if 0
//debugging: test, if the distances from p1, p2, p3 to result are equal
double dist1 = sqrt( ( p1->getX() - result->getX() ) * ( p1->getX() - result->getX() ) + ( p1->getY() - result->getY() ) * ( p1->getY() - result->getY() ) );
double dist2 = sqrt( ( p2->getX() - result->getX() ) * ( p2->getX() - result->getX() ) + ( p2->getY() - result->getY() ) * ( p2->getY() - result->getY() ) );
double dist3 = sqrt( ( p3->getX() - result->getX() ) * ( p3->getX() - result->getX() ) + ( p3->getY() - result->getY() ) * ( p3->getY() - result->getY() ) );
double dist1 = std::sqrt( ( p1->getX() - result->getX() ) * ( p1->getX() - result->getX() ) + ( p1->getY() - result->getY() ) * ( p1->getY() - result->getY() ) );
double dist2 = std::sqrt( ( p2->getX() - result->getX() ) * ( p2->getX() - result->getX() ) + ( p2->getY() - result->getY() ) * ( p2->getY() - result->getY() ) );
double dist3 = std::sqrt( ( p3->getX() - result->getX() ) * ( p3->getX() - result->getX() ) + ( p3->getY() - result->getY() ) * ( p3->getY() - result->getY() ) );

if ( dist1 - dist2 > 1 || dist2 - dist1 > 1 || dist1 - dist3 > 1 || dist3 - dist1 > 1 )
{
@@ -180,9 +180,9 @@ bool MathUtils::circumcenter( QgsPoint *p1, QgsPoint *p2, QgsPoint *p3, QgsPoint
MathUtils::lineIntersection( &midpoint12, &helppoint1, &midpoint23, &helppoint2, result );

//debugging: test, if the distances from p1, p2, p3 to result are equal
double dist1 = sqrt( ( p1->getX() - result->getX() ) * ( p1->getX() - result->getX() ) + ( p1->getY() - result->getY() ) * ( p1->getY() - result->getY() ) );
double dist2 = sqrt( ( p2->getX() - result->getX() ) * ( p2->getX() - result->getX() ) + ( p2->getY() - result->getY() ) * ( p2->getY() - result->getY() ) );
double dist3 = sqrt( ( p3->getX() - result->getX() ) * ( p3->getX() - result->getX() ) + ( p3->getY() - result->getY() ) * ( p3->getY() - result->getY() ) );
double dist1 = std::sqrt( ( p1->getX() - result->getX() ) * ( p1->getX() - result->getX() ) + ( p1->getY() - result->getY() ) * ( p1->getY() - result->getY() ) );
double dist2 = std::sqrt( ( p2->getX() - result->getX() ) * ( p2->getX() - result->getX() ) + ( p2->getY() - result->getY() ) * ( p2->getY() - result->getY() ) );
double dist3 = std::sqrt( ( p3->getX() - result->getX() ) * ( p3->getX() - result->getX() ) + ( p3->getY() - result->getY() ) * ( p3->getY() - result->getY() ) );

if ( dist1 - dist2 > 1 || dist2 - dist1 > 1 || dist1 - dist3 > 1 || dist3 - dist1 > 1 )
{
@@ -210,7 +210,7 @@ double MathUtils::distPointFromLine( QgsPoint *thepoint, QgsPoint *p1, QgsPoint
double a = normal.getX();
double b = normal.getY();
double c = -( normal.getX() * p2->x() + normal.getY() * p2->y() );
double distance = std::fabs( ( a * thepoint->x() + b * thepoint->y() + c ) / ( sqrt( a * a + b * b ) ) );
double distance = std::fabs( ( a * thepoint->x() + b * thepoint->y() + c ) / ( std::sqrt( a * a + b * b ) ) );
return distance;
}
else
@@ -619,7 +619,7 @@ bool MathUtils::normalLeft( Vector3D *v1, Vector3D *result, double length )
return false;
}

result->setX( ( -b + sqrt( d ) ) / ( 2 * a ) ); //take one of the two solutions of the quadratic equation
result->setX( ( -b + std::sqrt( d ) ) / ( 2 * a ) ); //take one of the two solutions of the quadratic equation
result->setY( ( -result->getX()*v1->getX() ) / v1->getY() );

QgsPoint point1( 0, 0, 0 );
@@ -676,7 +676,7 @@ bool MathUtils::normalRight( Vector3D *v1, Vector3D *result, double length )
return false;
}

result->setX( ( -b + sqrt( d ) ) / ( 2 * a ) ); //take one of the two solutions of the quadratic equation
result->setX( ( -b + std::sqrt( d ) ) / ( 2 * a ) ); //take one of the two solutions of the quadratic equation
result->setY( ( -result->getX()*v1->getX() ) / v1->getY() );

QgsPoint point1( 0, 0, 0 );
@@ -787,7 +787,7 @@ bool MathUtils::normalMinDistance( Vector3D *tangent, Vector3D *target, Vector3D
QgsDebugMsg( "warning, only complex solution of xg" );
return false;
}
xg1 = sqrt( xgalpha1 ) * ( -yt * yw * xt + yt * yt * xw + xw * zt * zt - zt * xt * zw );
xg1 = std::sqrt( xgalpha1 ) * ( -yt * yw * xt + yt * yt * xw + xw * zt * zt - zt * xt * zw );
xg2 = -sqrt( xgalpha1 ) * ( -yt * yw * xt + yt * yt * xw + xw * zt * zt - zt * xt * zw );

//calculate yg
@@ -798,7 +798,7 @@ bool MathUtils::normalMinDistance( Vector3D *tangent, Vector3D *target, Vector3D
return false;
}
yg1 = -sqrt( ygalpha1 ) * ( -yw * xt * xt - zt * zt * yw + zt * yt * zw + yt * xw * xt );
yg2 = sqrt( ygalpha1 ) * ( -yw * xt * xt - zt * zt * yw + zt * yt * zw + yt * xw * xt );
yg2 = std::sqrt( ygalpha1 ) * ( -yw * xt * xt - zt * zt * yw + zt * yt * zw + yt * xw * xt );

//calculate zg
double zgalpha1 = 1 / ( 2 * xt * xt * yw * yw * zt * zt - 2 * zt * zt * zt * xt * zw * xw + yt * yt * yt * yt * zw * zw + yt * yt * zw * zw * zt * zt + xt * xt * yt * yt * xw * xw + xt * xt * yw * yw * yt * yt - 2 * xt * xt * xt * zt * zw * xw + yt * yt * yt * yt * xw * xw + yt * yt * yw * yw * zt * zt + 2 * xt * xt * yt * yt * zw * zw - 2 * yt * yt * yt * yw * zt * zw + zt * zt * xt * xt * zw * zw + zt * zt * zt * zt * xw * xw + xt * xt * zt * zt * xw * xw + 2 * zt * zt * xw * xw * yt * yt - 2 * xt * xt * yw * zt * yt * zw - 2 * xt * yt * yt * yt * xw * yw - 2 * xt * xt * xt * yw * yt * xw - 2 * xt * zt * zt * xw * yt * yw - 2 * xt * zt * xw * yt * yt * zw - 2 * yw * zt * zt * zt * yt * zw + xt * xt * xt * xt * yw * yw + yw * yw * zt * zt * zt * zt + xt * xt * xt * xt * zw * zw );
@@ -808,10 +808,10 @@ bool MathUtils::normalMinDistance( Vector3D *tangent, Vector3D *target, Vector3D
return false;
}
zg1 = -sqrt( zgalpha1 ) * ( yt * yw * zt - yt * yt * zw + xw * zt * xt - xt * xt * zw );
zg2 = sqrt( zgalpha1 ) * ( yt * yw * zt - yt * yt * zw + xw * zt * xt - xt * xt * zw );
zg2 = std::sqrt( zgalpha1 ) * ( yt * yw * zt - yt * yt * zw + xw * zt * xt - xt * xt * zw );

double distance1 = sqrt( ( xw - xg1 ) * ( xw - xg1 ) + ( yw - yg1 ) * ( yw - yg1 ) + ( zw - zg1 ) * ( zw - zg1 ) );
double distance2 = sqrt( ( xw - xg2 ) * ( xw - xg2 ) + ( yw - yg2 ) * ( yw - yg2 ) + ( zw - zg2 ) * ( zw - zg2 ) );
double distance1 = std::sqrt( ( xw - xg1 ) * ( xw - xg1 ) + ( yw - yg1 ) * ( yw - yg1 ) + ( zw - zg1 ) * ( zw - zg1 ) );
double distance2 = std::sqrt( ( xw - xg2 ) * ( xw - xg2 ) + ( yw - yg2 ) * ( yw - yg2 ) + ( zw - zg2 ) * ( zw - zg2 ) );

if ( distance1 <= distance2 )//find out, which solution is the maximum and which the minimum
{
@@ -44,7 +44,7 @@ int QgsIDWInterpolator::interpolatePoint( double x, double y, double &result )

Q_FOREACH ( const vertexData &vertex_it, mCachedBaseData )
{
distance = sqrt( ( vertex_it.x - x ) * ( vertex_it.x - x ) + ( vertex_it.y - y ) * ( vertex_it.y - y ) );
distance = std::sqrt( ( vertex_it.x - x ) * ( vertex_it.x - x ) + ( vertex_it.y - y ) * ( vertex_it.y - y ) );
if ( ( distance - 0 ) < std::numeric_limits<double>::min() )
{
result = vertex_it.z;
@@ -38,7 +38,7 @@ float QgsHillshadeFilter::processNineCellWindow( float *x11, float *x21, float *
}

float zenith_rad = mLightAngle * M_PI / 180.0;
float slope_rad = atan( sqrt( derX * derX + derY * derY ) );
float slope_rad = atan( std::sqrt( derX * derX + derY * derY ) );
float azimuth_rad = mLightAzimuth * M_PI / 180.0;
float aspect_rad = 0;
if ( derX == 0 && derY == 0 ) //aspect undefined, take a neutral value. Better solutions?
@@ -181,7 +181,7 @@ QgsKernelDensityEstimation::Result QgsKernelDensityEstimation::addFeature( const
double pixelCentroidX = ( xPosition + xp + 0.5 ) * mPixelSize + mBounds.xMinimum();
double pixelCentroidY = ( yPosition + yp + 0.5 ) * mPixelSize + mBounds.yMinimum();

double distance = sqrt( std::pow( pixelCentroidX - ( *pointIt ).x(), 2.0 ) + std::pow( pixelCentroidY - ( *pointIt ).y(), 2.0 ) );
double distance = std::sqrt( std::pow( pixelCentroidX - ( *pointIt ).x(), 2.0 ) + std::pow( pixelCentroidY - ( *pointIt ).y(), 2.0 ) );

// is pixel outside search bandwidth of feature?
if ( distance > radius )
@@ -216,7 +216,7 @@ bool QgsRasterMatrix::oneArgumentOperation( OneArgOperator op )
}
else
{
mData[i] = sqrt( value );
mData[i] = std::sqrt( value );
}
break;
case opSIN:
@@ -34,6 +34,6 @@ float QgsSlopeFilter::processNineCellWindow( float *x11, float *x21, float *x31,
return mOutputNodataValue;
}

return atan( sqrt( derX * derX + derY * derY ) ) * 180.0 / M_PI;
return atan( std::sqrt( derX * derX + derY * derY ) ) * 180.0 / M_PI;
}

@@ -440,28 +440,28 @@ bool QgsTransectSample::closestSegmentPoints( const QgsGeometry &g1, const QgsGe

if ( d1 <= d2 && d1 <= d3 && d1 <= d4 )
{
dist = sqrt( d1 );
dist = std::sqrt( d1 );
pt1 = p11;
pt2 = minDistPoint1;
return true;
}
else if ( d2 <= d1 && d2 <= d3 && d2 <= d4 )
{
dist = sqrt( d2 );
dist = std::sqrt( d2 );
pt1 = p12;
pt2 = minDistPoint2;
return true;
}
else if ( d3 <= d1 && d3 <= d2 && d3 <= d4 )
{
dist = sqrt( d3 );
dist = std::sqrt( d3 );
pt1 = p21;
pt2 = minDistPoint3;
return true;
}
else
{
dist = sqrt( d4 );
dist = std::sqrt( d4 );
pt1 = p21;
pt2 = minDistPoint4;
return true;
@@ -512,7 +512,7 @@ bool QgsTransectSample::closestSegmentPoints( const QgsGeometry &g1, const QgsGe
pt1.sqrDistToSegment( p21.x(), p21.y(), p22.x(), p22.y(), pt2 );
}

dist = sqrt( pt1.sqrDist( pt2 ) );
dist = std::sqrt( pt1.sqrDist( pt2 ) );
return true;
}

@@ -175,7 +175,7 @@ class DRW_Coord
void unitize()
{
double dist;
dist = sqrt( x * x + y * y + z * z );
dist = std::sqrt( x * x + y * y + z * z );
if ( dist > 0.0 )
{
x = x / dist;

0 comments on commit b5ca4b4

Please sign in to comment.
You can’t perform that action at this time.