Skip to content

Commit fec03ca

Browse files
committed
(q)sin -> std::sin
1 parent 8c64d80 commit fec03ca

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+169
-169
lines changed

src/analysis/raster/qgshillshadefilter.cpp

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

src/analysis/raster/qgsrastermatrix.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ bool QgsRasterMatrix::oneArgumentOperation( OneArgOperator op )
220220
}
221221
break;
222222
case opSIN:
223-
mData[i] = sin( value );
223+
mData[i] = std::sin( value );
224224
break;
225225
case opCOS:
226226
mData[i] = std::cos( value );

src/analysis/raster/qgsrastermatrix.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ class ANALYSIS_EXPORT QgsRasterMatrix
124124
bool twoArgumentOperation( TwoArgOperator op, const QgsRasterMatrix &other );
125125
double calculateTwoArgumentOp( TwoArgOperator op, double arg1, double arg2 ) const;
126126

127-
/*sqrt, sin, std::cos, tan, asin, acos, atan*/
127+
/*sqrt, std::sin, std::cos, tan, asin, acos, atan*/
128128
bool oneArgumentOperation( OneArgOperator op );
129129
bool testPowerValidity( double base, double power ) const;
130130
};

src/app/dwg/libdxfrw/drw_entities.cpp

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

964964
incAngle = M_PIx2 / parts;
965965
double curAngle = staparam;
@@ -970,7 +970,7 @@ void DRW_Ellipse::toPolyline( DRW_Polyline *pol, int parts ) const
970970
while ( curAngle < endAngle )
971971
{
972972
double cosCurr = std::cos( curAngle );
973-
double sinCurr = sin( curAngle );
973+
double sinCurr = std::sin( curAngle );
974974
double x = basePoint.x + cosCurr * cosRot * radMajor - sinCurr * sinRot * radMinor;
975975
double y = basePoint.y + cosCurr * sinRot * radMajor + sinCurr * cosRot * radMinor;
976976
pol->addVertex( DRW_Vertex( x, y, 0.0, 0.0 ) );

src/app/dwg/qgsdwgimporter.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1341,9 +1341,9 @@ void QgsDwgImporter::addArc( const DRW_Arc &data )
13411341

13421342
QgsCircularString c;
13431343
c.setPoints( QgsPointSequence()
1344-
<< QgsPoint( QgsWkbTypes::PointZ, data.basePoint.x + std::cos( a0 ) * data.mRadius, data.basePoint.y + sin( a0 ) * data.mRadius )
1345-
<< QgsPoint( QgsWkbTypes::PointZ, data.basePoint.x + std::cos( a1 ) * data.mRadius, data.basePoint.y + sin( a1 ) * data.mRadius )
1346-
<< QgsPoint( QgsWkbTypes::PointZ, data.basePoint.x + std::cos( a2 ) * data.mRadius, data.basePoint.y + sin( a2 ) * data.mRadius )
1344+
<< QgsPoint( QgsWkbTypes::PointZ, data.basePoint.x + std::cos( a0 ) * data.mRadius, data.basePoint.y + std::sin( a0 ) * data.mRadius )
1345+
<< QgsPoint( QgsWkbTypes::PointZ, data.basePoint.x + std::cos( a1 ) * data.mRadius, data.basePoint.y + std::sin( a1 ) * data.mRadius )
1346+
<< QgsPoint( QgsWkbTypes::PointZ, data.basePoint.x + std::cos( a2 ) * data.mRadius, data.basePoint.y + std::sin( a2 ) * data.mRadius )
13471347
);
13481348

13491349
if ( !createFeature( layer, f, c ) )
@@ -1445,7 +1445,7 @@ bool QgsDwgImporter::curveFromLWPolyline( const DRW_LWPolyline &data, QgsCompoun
14451445
double dx = data.vertlist[i1]->x - data.vertlist[i0]->x;
14461446
double dy = data.vertlist[i1]->y - data.vertlist[i0]->y;
14471447
double c = sqrt( dx * dx + dy * dy );
1448-
double r = c / 2.0 / sin( a );
1448+
double r = c / 2.0 / std::sin( a );
14491449
double h = r * ( 1 - std::cos( a ) );
14501450

14511451
s << QgsPoint( QgsWkbTypes::PointZ,
@@ -1556,7 +1556,7 @@ void QgsDwgImporter::addLWPolyline( const DRW_LWPolyline &data )
15561556
double dx = p1.x() - p0.x();
15571557
double dy = p1.y() - p0.y();
15581558
double c = sqrt( dx * dx + dy * dy );
1559-
double r = c / 2.0 / sin( a );
1559+
double r = c / 2.0 / std::sin( a );
15601560
double h = r * ( 1 - std::cos( a ) );
15611561

15621562
s << QgsPoint( QgsWkbTypes::PointZ,
@@ -1758,7 +1758,7 @@ void QgsDwgImporter::addPolyline( const DRW_Polyline &data )
17581758
double dy = p1.y() - p0.y();
17591759
double dz = p1.z() - p0.z();
17601760
double c = sqrt( dx * dx + dy * dy );
1761-
double r = c / 2.0 / sin( a );
1761+
double r = c / 2.0 / std::sin( a );
17621762
double h = r * ( 1 - std::cos( a ) );
17631763

17641764
s << QgsPoint( QgsWkbTypes::PointZ,

src/app/nodetool/qgsnodetool.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -683,7 +683,7 @@ QgsPointXY QgsNodeTool::positionForEndpointMarker( const QgsPointLocator::Match
683683
double dist = 15 * canvas()->mapSettings().mapUnitsPerPixel();
684684
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() + std::cos( angle ) * dist;
686-
double y = pt1.y() + sin( angle ) * dist;
686+
double y = pt1.y() + std::sin( angle ) * dist;
687687
return QgsPointXY( x, y );
688688
}
689689

src/app/qgsdecorationnortharrow.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,10 +138,10 @@ void QgsDecorationNorthArrow::render( const QgsMapSettings &mapSettings, QgsRend
138138
double myRadiansDouble = mRotationInt * M_PI / 180.0;
139139
int xShift = static_cast<int>( (
140140
( centerXDouble * std::cos( myRadiansDouble ) ) +
141-
( centerYDouble * sin( myRadiansDouble ) )
141+
( centerYDouble * std::sin( myRadiansDouble ) )
142142
) - centerXDouble );
143143
int yShift = static_cast<int>( (
144-
( -centerXDouble * sin( myRadiansDouble ) ) +
144+
( -centerXDouble * std::sin( myRadiansDouble ) ) +
145145
( centerYDouble * std::cos( myRadiansDouble ) )
146146
) - centerYDouble );
147147

src/app/qgsdecorationnortharrowdialog.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,10 +156,10 @@ void QgsDecorationNorthArrowDialog::drawNorthArrow()
156156
double myRadiansDouble = ( PI / 180 ) * rotation;
157157
int xShift = static_cast<int>( (
158158
( centerXDouble * std::cos( myRadiansDouble ) ) +
159-
( centerYDouble * sin( myRadiansDouble ) )
159+
( centerYDouble * std::sin( myRadiansDouble ) )
160160
) - centerXDouble );
161161
int yShift = static_cast<int>( (
162-
( -centerXDouble * sin( myRadiansDouble ) ) +
162+
( -centerXDouble * std::sin( myRadiansDouble ) ) +
163163
( centerYDouble * std::cos( myRadiansDouble ) )
164164
) - centerYDouble );
165165

src/app/qgsmaptoollabel.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -376,8 +376,8 @@ bool QgsMapToolLabel::currentLabelRotationPoint( QgsPointXY &pos, bool ignoreUps
376376
}
377377

378378
double angle = mCurrentLabel.pos.rotation;
379-
double xd = xdiff * std::cos( angle ) - ydiff * sin( angle );
380-
double yd = xdiff * sin( angle ) + ydiff * std::cos( angle );
379+
double xd = xdiff * std::cos( angle ) - ydiff * std::sin( angle );
380+
double yd = xdiff * std::sin( angle ) + ydiff * std::cos( angle );
381381
if ( mCurrentLabel.pos.upsideDown && !ignoreUpsideDown )
382382
{
383383
pos.setX( pos.x() - xd );

src/app/qgsmaptooloffsetpointsymbol.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ QPointF QgsMapToolOffsetPointSymbol::calculateOffset( const QgsPointXY &startPoi
270270
QPointF QgsMapToolOffsetPointSymbol::rotatedOffset( QPointF offset, double angle ) const
271271
{
272272
angle = DEG2RAD( 360 - angle );
273-
double c = std::cos( angle ), s = sin( angle );
273+
double c = std::cos( angle ), s = std::sin( angle );
274274
return QPointF( offset.x() * c - offset.y() * s, offset.x() * s + offset.y() * c );
275275
}
276276

0 commit comments

Comments
 (0)