Skip to content

Commit 249b505

Browse files
committed
(q)atan2 -> std::atan2
1 parent 031bf41 commit 249b505

21 files changed

+70
-70
lines changed

src/analysis/raster/qgsaspectfilter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ float QgsAspectFilter::processNineCellWindow(
3939
}
4040
else
4141
{
42-
return 180.0 + atan2( derX, derY ) * 180.0 / M_PI;
42+
return 180.0 + std::atan2( derX, derY ) * 180.0 / M_PI;
4343
}
4444
}
4545

src/analysis/raster/qgshillshadefilter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ float QgsHillshadeFilter::processNineCellWindow( float *x11, float *x21, float *
4747
}
4848
else
4949
{
50-
aspect_rad = M_PI + atan2( derX, derY );
50+
aspect_rad = M_PI + std::atan2( derX, derY );
5151
}
5252
return qMax( 0.0, 255.0 * ( ( cos( zenith_rad ) * cos( slope_rad ) ) + ( sin( zenith_rad ) * sin( slope_rad ) * cos( azimuth_rad - aspect_rad ) ) ) );
5353
}

src/app/dwg/libdxfrw/drw_entities.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -957,7 +957,7 @@ void DRW_Ellipse::toPolyline( DRW_Polyline *pol, int parts ) const
957957
double radMajor = sqrt( secPoint.x * secPoint.x + secPoint.y * secPoint.y );
958958
double radMinor = radMajor * ratio;
959959
//calculate sin & cos of included angle
960-
double incAngle = atan2( secPoint.y, secPoint.x );
960+
double incAngle = std::atan2( secPoint.y, secPoint.x );
961961
double cosRot = cos( incAngle );
962962
double sinRot = sin( incAngle );
963963

@@ -1860,7 +1860,7 @@ void DRW_MText::updateAngle()
18601860
{
18611861
if ( haveXAxis )
18621862
{
1863-
angle = atan2( secPoint.y, secPoint.x ) * 180 / M_PI;
1863+
angle = std::atan2( secPoint.y, secPoint.x ) * 180 / M_PI;
18641864
}
18651865
}
18661866

src/app/nodetool/qgsnodetool.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -681,7 +681,7 @@ QgsPointXY QgsNodeTool::positionForEndpointMarker( const QgsPointLocator::Match
681681
double dx = pt1.x() - pt0.x();
682682
double dy = pt1.y() - pt0.y();
683683
double dist = 15 * canvas()->mapSettings().mapUnitsPerPixel();
684-
double angle = atan2( dy, dx ); // to the top: angle=0, to the right: angle=90, to the left: angle=-90
684+
double angle = std::atan2( dy, dx ); // to the top: angle=0, to the right: angle=90, to the left: angle=-90
685685
double x = pt1.x() + cos( angle ) * dist;
686686
double y = pt1.y() + sin( angle ) * dist;
687687
return QgsPointXY( x, y );

src/app/qgsmaptoolrotatefeature.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ void QgsMapToolRotateFeature::canvasMoveEvent( QgsMapMouseEvent *e )
152152
{
153153
const double XDistance = e->pos().x() - mStPoint.x();
154154
const double YDistance = e->pos().y() - mStPoint.y();
155-
double rotation = atan2( YDistance, XDistance ) * ( 180 / PI );
155+
double rotation = std::atan2( YDistance, XDistance ) * ( 180 / PI );
156156

157157
if ( mRotationWidget )
158158
{
@@ -297,7 +297,7 @@ void QgsMapToolRotateFeature::canvasReleaseEvent( QgsMapMouseEvent *e )
297297

298298
double XDistance = mInitialPos.x() - mAnchorPoint->x();
299299
double YDistance = mInitialPos.y() - mAnchorPoint->y() ;
300-
mRotationOffset = atan2( YDistance, XDistance ) * ( 180 / PI );
300+
mRotationOffset = std::atan2( YDistance, XDistance ) * ( 180 / PI );
301301

302302
createRotationWidget();
303303
if ( e->modifiers() & Qt::ShiftModifier )

src/app/qgsmaptoolrotatepointsymbols.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ double QgsMapToolRotatePointSymbols::calculateAzimut( QPoint mousePos )
204204
{
205205
int dx = mousePos.x() - mSnappedPoint.x();
206206
int dy = mousePos.y() - mSnappedPoint.y();
207-
return 180 - atan2( ( double ) dx, ( double ) dy ) * 180.0 / M_PI;
207+
return 180 - std::atan2( ( double ) dx, ( double ) dy ) * 180.0 / M_PI;
208208
}
209209

210210
void QgsMapToolRotatePointSymbols::createPixmapItem( QgsMarkerSymbol *markerSymbol )

src/core/expression/qgsexpressionfunction.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ static QVariant fcnAtan2( const QVariantList &values, const QgsExpressionContext
288288
{
289289
double y = QgsExpressionUtils::getDoubleValue( values.at( 0 ), parent );
290290
double x = QgsExpressionUtils::getDoubleValue( values.at( 1 ), parent );
291-
return QVariant( atan2( y, x ) );
291+
return QVariant( std::atan2( y, x ) );
292292
}
293293
static QVariant fcnExp( const QVariantList &values, const QgsExpressionContext *, QgsExpression *parent )
294294
{

src/core/geometry/qgsellipse.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ QgsPointSequence QgsEllipse::points( unsigned int segments ) const
199199
double m = mCenter.m();
200200

201201
QVector<double> t;
202-
double azimuth = atan2( quadrant().at( 0 ).y() - mCenter.y(), quadrant().at( 0 ).x() - mCenter.x() );
202+
double azimuth = std::atan2( quadrant().at( 0 ).y() - mCenter.y(), quadrant().at( 0 ).x() - mCenter.x() );
203203
for ( unsigned int i = 0; i < segments; ++i )
204204
{
205205
t.append( 2 * M_PI - ( ( 2 * M_PI ) / segments * i ) ); // Since the algorithm used rotates in the trigonometric direction (counterclockwise)

src/core/geometry/qgsgeometryutils.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,7 @@ QgsPoint QgsGeometryUtils::pointOnLineWithDistance( const QgsPoint &startPoint,
430430

431431
double QgsGeometryUtils::ccwAngle( double dy, double dx )
432432
{
433-
double angle = atan2( dy, dx ) * 180 / M_PI;
433+
double angle = std::atan2( dy, dx ) * 180 / M_PI;
434434
if ( angle < 0 )
435435
{
436436
return 360 + angle;
@@ -664,9 +664,9 @@ void QgsGeometryUtils::segmentizeArc( const QgsPoint &p1, const QgsPoint &p2, co
664664
}
665665

666666
//angles of pt1, pt2, pt3
667-
double a1 = atan2( circlePoint1.y() - centerY, circlePoint1.x() - centerX );
668-
double a2 = atan2( circlePoint2.y() - centerY, circlePoint2.x() - centerX );
669-
double a3 = atan2( circlePoint3.y() - centerY, circlePoint3.x() - centerX );
667+
double a1 = std::atan2( circlePoint1.y() - centerY, circlePoint1.x() - centerX );
668+
double a2 = std::atan2( circlePoint2.y() - centerY, circlePoint2.x() - centerX );
669+
double a3 = std::atan2( circlePoint3.y() - centerY, circlePoint3.x() - centerX );
670670

671671
/* Adjust a3 up so we can increment from a1 to a3 cleanly */
672672
if ( a3 <= a1 )
@@ -1092,15 +1092,15 @@ QgsLineString QgsGeometryUtils::perpendicularSegment( const QgsPoint &p, const Q
10921092

10931093
double QgsGeometryUtils::lineAngle( double x1, double y1, double x2, double y2 )
10941094
{
1095-
double at = atan2( y2 - y1, x2 - x1 );
1095+
double at = std::atan2( y2 - y1, x2 - x1 );
10961096
double a = -at + M_PI / 2.0;
10971097
return normalizedAngle( a );
10981098
}
10991099

11001100
double QgsGeometryUtils::angleBetweenThreePoints( double x1, double y1, double x2, double y2, double x3, double y3 )
11011101
{
1102-
double angle1 = atan2( y1 - y2, x1 - x2 );
1103-
double angle2 = atan2( y3 - y2, x3 - x2 );
1102+
double angle1 = std::atan2( y1 - y2, x1 - x2 );
1103+
double angle2 = std::atan2( y3 - y2, x3 - x2 );
11041104
return normalizedAngle( angle1 - angle2 );
11051105
}
11061106

src/core/geometry/qgspoint.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -538,7 +538,7 @@ double QgsPoint::azimuth( const QgsPoint &other ) const
538538
{
539539
double dx = other.x() - mX;
540540
double dy = other.y() - mY;
541-
return ( atan2( dx, dy ) * 180.0 / M_PI );
541+
return ( std::atan2( dx, dy ) * 180.0 / M_PI );
542542
}
543543

544544
double QgsPoint::inclination( const QgsPoint &other ) const

src/core/pal/feature.cpp

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -456,8 +456,8 @@ int FeaturePart::createCandidatesAroundPoint( double x, double y, QList< LabelPo
456456

457457
if ( distanceToLabel > 0 )
458458
{
459-
gamma1 = atan2( labelHeight / 2, distanceToLabel + labelWidth / 2 );
460-
gamma2 = atan2( labelWidth / 2, distanceToLabel + labelHeight / 2 );
459+
gamma1 = std::atan2( labelHeight / 2, distanceToLabel + labelWidth / 2 );
460+
gamma2 = std::atan2( labelWidth / 2, distanceToLabel + labelHeight / 2 );
461461
}
462462
else
463463
{
@@ -629,7 +629,7 @@ int FeaturePart::createCandidatesAlongLineNearStraightSegments( QList<LabelPosit
629629
continue;
630630
if ( qgsDoubleNear( y1, y2 ) && qgsDoubleNear( x1, x2 ) )
631631
continue;
632-
double vertexAngle = M_PI - ( atan2( y3 - y2, x3 - x2 ) - atan2( y2 - y1, x2 - x1 ) );
632+
double vertexAngle = M_PI - ( std::atan2( y3 - y2, x3 - x2 ) - std::atan2( y2 - y1, x2 - x1 ) );
633633
vertexAngle = QgsGeometryUtils::normalizedAngle( vertexAngle );
634634

635635
// extreme angles form more than 45 degree angle at a node - these are the ones we don't want labels to cross
@@ -670,7 +670,7 @@ int FeaturePart::createCandidatesAlongLineNearStraightSegments( QList<LabelPosit
670670
{
671671
// at an extreme angle node, so reset counters
672672
straightSegmentLengths << currentStraightSegmentLength;
673-
straightSegmentAngles << QgsGeometryUtils::normalizedAngle( atan2( y[i] - segmentStartY, x[i] - segmentStartX ) );
673+
straightSegmentAngles << QgsGeometryUtils::normalizedAngle( std::atan2( y[i] - segmentStartY, x[i] - segmentStartX ) );
674674
longestSegmentLength = qMax( longestSegmentLength, currentStraightSegmentLength );
675675
segmentIndex++;
676676
currentStraightSegmentLength = 0;
@@ -681,7 +681,7 @@ int FeaturePart::createCandidatesAlongLineNearStraightSegments( QList<LabelPosit
681681
}
682682
distanceToSegment[line->nbPoints - 1] = totalLineLength;
683683
straightSegmentLengths << currentStraightSegmentLength;
684-
straightSegmentAngles << QgsGeometryUtils::normalizedAngle( atan2( y[numberNodes - 1] - segmentStartY, x[numberNodes - 1] - segmentStartX ) );
684+
straightSegmentAngles << QgsGeometryUtils::normalizedAngle( std::atan2( y[numberNodes - 1] - segmentStartY, x[numberNodes - 1] - segmentStartX ) );
685685
longestSegmentLength = qMax( longestSegmentLength, currentStraightSegmentLength );
686686
double middleOfLine = totalLineLength / 2.0;
687687

@@ -765,7 +765,7 @@ int FeaturePart::createCandidatesAlongLineNearStraightSegments( QList<LabelPosit
765765
angle = 0.0;
766766
}
767767
else
768-
angle = atan2( candidateEndY - candidateStartY, candidateEndX - candidateStartX );
768+
angle = std::atan2( candidateEndY - candidateStartY, candidateEndX - candidateStartX );
769769

770770
beta = angle + M_PI / 2;
771771

@@ -910,7 +910,7 @@ int FeaturePart::createCandidatesAlongLineNearMidpoint( QList<LabelPosition *> &
910910
angle = 0.0;
911911
}
912912
else
913-
angle = atan2( candidateEndY - candidateStartY, candidateEndX - candidateStartX );
913+
angle = std::atan2( candidateEndY - candidateStartY, candidateEndX - candidateStartX );
914914

915915
beta = angle + M_PI / 2;
916916

@@ -1022,7 +1022,7 @@ LabelPosition *FeaturePart::curvedPlacementAtOffset( PointSet *path_positions, d
10221022
// Determine the angle of the path segment under consideration
10231023
double dx = path_positions->x[endindex] - path_positions->x[index];
10241024
double dy = path_positions->y[endindex] - path_positions->y[index];
1025-
double line_angle = atan2( -dy, dx );
1025+
double line_angle = std::atan2( -dy, dx );
10261026

10271027
bool isRightToLeft = ( line_angle > 0.55 * M_PI || line_angle < -0.45 * M_PI );
10281028
reversed = isRightToLeft;
@@ -1051,7 +1051,7 @@ LabelPosition *FeaturePart::curvedPlacementAtOffset( PointSet *path_positions, d
10511051
double dx = new_x - old_x;
10521052
double dy = new_y - old_y;
10531053

1054-
double angle = atan2( -dy, dx );
1054+
double angle = std::atan2( -dy, dx );
10551055

10561056
for ( int i = 0; i < li->char_num; i++ )
10571057
{
@@ -1071,7 +1071,7 @@ LabelPosition *FeaturePart::curvedPlacementAtOffset( PointSet *path_positions, d
10711071
}
10721072

10731073
// Calculate angle from the start of the character to the end based on start_/end_ position
1074-
angle = atan2( start_y - end_y, end_x - start_x );
1074+
angle = std::atan2( start_y - end_y, end_x - start_x );
10751075

10761076
// Test last_character_angle vs angle
10771077
// since our rendering angle has changed then check against our
@@ -1246,7 +1246,7 @@ int FeaturePart::createCurvedCandidatesAlongLine( QList< LabelPosition * > &lPos
12461246
slp->setCost( cost );
12471247

12481248
// average angle is calculated with respect to periodicity of angles
1249-
double angle_avg = atan2( sin_avg / li->char_num, cos_avg / li->char_num );
1249+
double angle_avg = std::atan2( sin_avg / li->char_num, cos_avg / li->char_num );
12501250
bool localreversed = flip ? !reversed : reversed;
12511251
// displacement - we loop through 3 times, generating above, online then below line placements successively
12521252
for ( int i = 0; i <= 2; ++i )
@@ -1446,7 +1446,7 @@ int FeaturePart::createCandidatesForPolygon( QList< LabelPosition *> &lPos, Poin
14461446
alpha = box->alpha;
14471447
}
14481448

1449-
beta = atan2( labelHeight, labelWidth ) + alpha;
1449+
beta = std::atan2( labelHeight, labelWidth ) + alpha;
14501450

14511451

14521452
//alpha = box->alpha;

src/core/qgsdistancearea.cpp

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,7 @@ QgsPointXY QgsDistanceArea::computeSpheroidProject(
426426
{
427427
azimuth = azimuth - M_PI * 2.0;
428428
}
429-
sigma1 = atan2( tan_u1, cos( azimuth ) );
429+
sigma1 = std::atan2( tan_u1, cos( azimuth ) );
430430
sin_alpha = cos( u1 ) * sin( azimuth );
431431
alpha = asin( sin_alpha );
432432
cos_alphasq = 1.0 - POW2( sin_alpha );
@@ -444,12 +444,12 @@ QgsPointXY QgsDistanceArea::computeSpheroidProject(
444444
}
445445
while ( i < 999 && std::fabs( ( last_sigma - sigma ) / sigma ) > 1.0e-9 );
446446

447-
lat2 = atan2( ( sin( u1 ) * cos( sigma ) + cos( u1 ) * sin( sigma ) *
448-
cos( azimuth ) ), ( omf * sqrt( POW2( sin_alpha ) +
449-
POW2( sin( u1 ) * sin( sigma ) - cos( u1 ) * cos( sigma ) *
450-
cos( azimuth ) ) ) ) );
451-
lambda = atan2( ( sin( sigma ) * sin( azimuth ) ), ( cos( u1 ) * cos( sigma ) -
452-
sin( u1 ) * sin( sigma ) * cos( azimuth ) ) );
447+
lat2 = std::atan2( ( sin( u1 ) * cos( sigma ) + cos( u1 ) * sin( sigma ) *
448+
cos( azimuth ) ), ( omf * sqrt( POW2( sin_alpha ) +
449+
POW2( sin( u1 ) * sin( sigma ) - cos( u1 ) * cos( sigma ) *
450+
cos( azimuth ) ) ) ) );
451+
lambda = std::atan2( ( sin( sigma ) * sin( azimuth ) ), ( cos( u1 ) * cos( sigma ) -
452+
sin( u1 ) * sin( sigma ) * cos( azimuth ) ) );
453453
C = ( f / 16.0 ) * cos_alphasq * ( 4.0 + f * ( 4.0 - 3.0 * cos_alphasq ) );
454454
omega = lambda - ( 1.0 - C ) * f * sin_alpha * ( sigma + C * sin( sigma ) *
455455
( cos( two_sigma_m ) + C * cos( sigma ) * ( -1.0 + 2.0 * POW2( cos( two_sigma_m ) ) ) ) );
@@ -525,7 +525,7 @@ double QgsDistanceArea::bearing( const QgsPointXY &p1, const QgsPointXY &p2 ) co
525525
{
526526
double dx = p2.x() - p1.x();
527527
double dy = p2.y() - p1.y();
528-
bearing = atan2( dx, dy );
528+
bearing = std::atan2( dx, dy );
529529
}
530530

531531
return bearing;
@@ -579,7 +579,7 @@ double QgsDistanceArea::computeDistanceBearing(
579579
tu2 = ( cosU1 * sinU2 - sinU1 * cosU2 * cosLambda );
580580
sinSigma = sqrt( tu1 * tu1 + tu2 * tu2 );
581581
cosSigma = sinU1 * sinU2 + cosU1 * cosU2 * cosLambda;
582-
sigma = atan2( sinSigma, cosSigma );
582+
sigma = std::atan2( sinSigma, cosSigma );
583583
alpha = asin( cosU1 * cosU2 * sinLambda / sinSigma );
584584
cosSqAlpha = cos( alpha ) * cos( alpha );
585585
cos2SigmaM = cosSigma - 2 * sinU1 * sinU2 / cosSqAlpha;
@@ -601,12 +601,12 @@ double QgsDistanceArea::computeDistanceBearing(
601601

602602
if ( course1 )
603603
{
604-
*course1 = atan2( tu1, tu2 );
604+
*course1 = std::atan2( tu1, tu2 );
605605
}
606606
if ( course2 )
607607
{
608608
// PI is added to return azimuth from P2 to P1
609-
*course2 = atan2( cosU1 * sinLambda, -sinU1 * cosU2 + cosU1 * sinU2 * cosLambda ) + M_PI;
609+
*course2 = std::atan2( cosU1 * sinLambda, -sinU1 * cosU2 + cosU1 * sinU2 * cosLambda ) + M_PI;
610610
}
611611

612612
return s;

src/core/qgspointxy.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ double QgsPointXY::azimuth( const QgsPointXY &other ) const
285285
{
286286
double dx = other.x() - mX;
287287
double dy = other.y() - mY;
288-
return ( atan2( dx, dy ) * 180.0 / M_PI );
288+
return ( std::atan2( dx, dy ) * 180.0 / M_PI );
289289
}
290290

291291
QgsPointXY QgsPointXY::project( double distance, double bearing ) const

src/core/qgsscalecalculator.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ double QgsScaleCalculator::calculateGeographicDistance( const QgsRectangle &mapE
117117
double lat = ( mapExtent.yMaximum() + mapExtent.yMinimum() ) * 0.5;
118118
static const double RADS = ( 4.0 * atan( 1.0 ) ) / 180.0;
119119
double a = std::pow( cos( lat * RADS ), 2 );
120-
double c = 2.0 * atan2( sqrt( a ), sqrt( 1.0 - a ) );
120+
double c = 2.0 * std::atan2( sqrt( a ), sqrt( 1.0 - a ) );
121121
static const double RA = 6378000; // [m]
122122
// The eccentricity. This comes from sqrt(1.0 - rb*rb/(ra*ra)) with rb set
123123
// to 6357000 m.

src/core/qgsvector.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ QgsVector QgsVector::perpVector() const
9696

9797
double QgsVector::angle() const
9898
{
99-
double angle = atan2( mY, mX );
99+
double angle = std::atan2( mY, mX );
100100
return angle < 0.0 ? angle + 2.0 * M_PI : angle;
101101
}
102102

@@ -107,7 +107,7 @@ double QgsVector::angle( QgsVector v ) const
107107

108108
QgsVector QgsVector::rotateBy( double rot ) const
109109
{
110-
double angle = atan2( mY, mX ) + rot;
110+
double angle = std::atan2( mY, mX ) + rot;
111111
double len = length();
112112
return QgsVector( len * cos( angle ), len * sin( angle ) );
113113
}

src/core/raster/qgshillshaderenderer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ QgsRasterBlock *QgsHillshadeRenderer::block( int bandNo, const QgsRectangle &ext
211211
double derY = calcFirstDerY( x11, x21, x31, x12, x22, x32, x13, x23, x33, cellYSize );
212212

213213
double slopeRad = atan( mZFactor * sqrt( derX * derX + derY * derY ) );
214-
double aspectRad = atan2( derX, -derY );
214+
double aspectRad = std::atan2( derX, -derY );
215215

216216

217217
double grayValue;

src/core/symbology/qgsarrowsymbollayer.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -438,8 +438,8 @@ void spiralArcTo( QPainterPath &path, QPointF center, qreal startAngle, qreal st
438438
else
439439
{
440440
// angles in the new circle
441-
qreal a1 = atan2( cCenter.y() - A.y(), A.x() - cCenter.x() );
442-
qreal a2 = atan2( cCenter.y() - I2.y(), I2.x() - cCenter.x() );
441+
qreal a1 = std::atan2( cCenter.y() - A.y(), A.x() - cCenter.x() );
442+
qreal a2 = std::atan2( cCenter.y() - I2.y(), I2.x() - cCenter.x() );
443443
pathArcTo( path, cCenter, cRadius, a1, a2, direction );
444444
}
445445

@@ -452,8 +452,8 @@ void spiralArcTo( QPainterPath &path, QPointF center, qreal startAngle, qreal st
452452
else
453453
{
454454
// angles in the new circle
455-
qreal a1 = atan2( cCenter.y() - I2.y(), I2.x() - cCenter.x() );
456-
qreal a2 = atan2( cCenter.y() - B.y(), B.x() - cCenter.x() );
455+
qreal a1 = std::atan2( cCenter.y() - I2.y(), I2.x() - cCenter.x() );
456+
qreal a2 = std::atan2( cCenter.y() - B.y(), B.x() - cCenter.x() );
457457
pathArcTo( path, cCenter, cRadius, a1, a2, direction );
458458
}
459459
}
@@ -473,9 +473,9 @@ QPolygonF curvedArrow( QPointF po, QPointF pm, QPointF pd,
473473
}
474474

475475
// angles of each point
476-
qreal angle_o = clampAngle( atan2( circleCenter.y() - po.y(), po.x() - circleCenter.x() ) );
477-
qreal angle_m = clampAngle( atan2( circleCenter.y() - pm.y(), pm.x() - circleCenter.x() ) );
478-
qreal angle_d = clampAngle( atan2( circleCenter.y() - pd.y(), pd.x() - circleCenter.x() ) );
476+
qreal angle_o = clampAngle( std::atan2( circleCenter.y() - po.y(), po.x() - circleCenter.x() ) );
477+
qreal angle_m = clampAngle( std::atan2( circleCenter.y() - pm.y(), pm.x() - circleCenter.x() ) );
478+
qreal angle_d = clampAngle( std::atan2( circleCenter.y() - pd.y(), pd.x() - circleCenter.x() ) );
479479

480480
// arc direction : 1 = counter-clockwise, -1 = clockwise
481481
int direction = clampAngle( angle_m - angle_o ) < clampAngle( angle_m - angle_d ) ? 1 : -1;

src/core/symbology/qgsfillsymbollayer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2594,7 +2594,7 @@ void QgsLinePatternFillSymbolLayer::applyPattern( const QgsSymbolRenderContext &
25942594
width = outputPixelDist / sin( lineAngle * M_PI / 180 );
25952595

25962596
// recalculate real angle and distance after rounding to pixels
2597-
lineAngle = 180 * atan2( static_cast< double >( height ), static_cast< double >( width ) ) / M_PI;
2597+
lineAngle = 180 * std::atan2( static_cast< double >( height ), static_cast< double >( width ) ) / M_PI;
25982598
if ( lineAngle < 0 )
25992599
{
26002600
lineAngle += 360.;

src/core/symbology/qgslinesymbollayer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1004,7 +1004,7 @@ static double _averageAngle( QPointF prevPt, QPointF pt, QPointF nextPt )
10041004
double a2 = MyLine( pt, nextPt ).angle();
10051005
double unitX = cos( a1 ) + cos( a2 ), unitY = sin( a1 ) + sin( a2 );
10061006

1007-
return atan2( unitY, unitX );
1007+
return std::atan2( unitY, unitX );
10081008
}
10091009

10101010
void QgsMarkerLineSymbolLayer::renderPolylineVertex( const QPolygonF &points, QgsSymbolRenderContext &context, Placement placement )

0 commit comments

Comments
 (0)