diff options
54 files changed, 233 insertions, 242 deletions
diff --git a/basegfx/source/curve/b2dcubicbezier.cxx b/basegfx/source/curve/b2dcubicbezier.cxx index 046f0cf30e17..a04c17568b38 100644 --- a/basegfx/source/curve/b2dcubicbezier.cxx +++ b/basegfx/source/curve/b2dcubicbezier.cxx @@ -66,7 +66,7 @@ namespace basegfx const double fCurrentAngle(aLeft.angle(aRight)); - if(fabs(fCurrentAngle) > (F_PI - fAngleBound)) + if(fabs(fCurrentAngle) > (M_PI - fAngleBound)) { // end recursion nMaxRecursionDepth = 0; @@ -203,7 +203,7 @@ namespace basegfx const B2DVector aLeftLeft(bLeftEqualZero ? aS2L - aS1L : aS1L - rfPA); // #i72104# const B2DVector aRightLeft(aS2L - aS3C); const double fCurrentAngleLeft(aLeftLeft.angle(aRightLeft)); - bAngleIsSmallerLeft = (fabs(fCurrentAngleLeft) > (F_PI - rfAngleBound)); + bAngleIsSmallerLeft = (fabs(fCurrentAngleLeft) > (M_PI - rfAngleBound)); } // test right @@ -213,7 +213,7 @@ namespace basegfx const B2DVector aLeftRight(aS2R - aS3C); const B2DVector aRightRight(bRightEqualZero ? aS2R - aS1R : aS1R - rfPB); // #i72104# const double fCurrentAngleRight(aLeftRight.angle(aRightRight)); - bAngleIsSmallerRight = (fabs(fCurrentAngleRight) > (F_PI - rfAngleBound)); + bAngleIsSmallerRight = (fabs(fCurrentAngleRight) > (M_PI - rfAngleBound)); } if(bAngleIsSmallerLeft && bAngleIsSmallerRight) diff --git a/basegfx/source/matrix/b2dhommatrixtools.cxx b/basegfx/source/matrix/b2dhommatrixtools.cxx index 72256688c0b2..f621b8f879ad 100644 --- a/basegfx/source/matrix/b2dhommatrixtools.cxx +++ b/basegfx/source/matrix/b2dhommatrixtools.cxx @@ -26,7 +26,7 @@ namespace basegfx::utils { void createSinCosOrthogonal(double& o_rSin, double& o_rCos, double fRadiant) { - if( fTools::equalZero( fmod( fRadiant, F_PI2 ) ) ) + if( fTools::equalZero( fmod( fRadiant, M_PI_2 ) ) ) { // determine quadrant const sal_Int32 nQuad( diff --git a/basegfx/source/matrix/b3dhommatrix.cxx b/basegfx/source/matrix/b3dhommatrix.cxx index 1382ff3c4a0f..3605767d681d 100644 --- a/basegfx/source/matrix/b3dhommatrix.cxx +++ b/basegfx/source/matrix/b3dhommatrix.cxx @@ -507,13 +507,13 @@ namespace basegfx if( ::basegfx::fTools::equal( aCol0.getZ(), 1.0 ) || aCol0.getZ() > 1.0 ) { - fy = -F_PI/2.0; + fy = -M_PI/2.0; cy = 0.0; } else if( ::basegfx::fTools::equal( aCol0.getZ(), -1.0 ) || aCol0.getZ() < -1.0 ) { - fy = F_PI/2.0; + fy = M_PI/2.0; cy = 0.0; } else diff --git a/basegfx/source/polygon/b2dlinegeometry.cxx b/basegfx/source/polygon/b2dlinegeometry.cxx index 4bba7cb009f9..03d73a8d3028 100644 --- a/basegfx/source/polygon/b2dlinegeometry.cxx +++ b/basegfx/source/polygon/b2dlinegeometry.cxx @@ -103,7 +103,7 @@ namespace basegfx::utils // from that vector, take the needed rotation and add rotate for arrow to transformation const B2DVector aTargetDirection(aHead - aTail); - const double fRotation(atan2(aTargetDirection.getY(), aTargetDirection.getX()) + F_PI2); + const double fRotation(atan2(aTargetDirection.getY(), aTargetDirection.getX()) + M_PI_2); // rotate around docking position aArrowTransform.rotate(fRotation); @@ -389,7 +389,7 @@ namespace basegfx utils::createScaleShearXRotateTranslateB2DHomMatrix( fHalfLineWidth, fHalfLineWidth, 0.0, - atan2(aTangentA.getY(), aTangentA.getX()) + F_PI2, + atan2(aTangentA.getY(), aTangentA.getX()) + M_PI_2, rEdge.getStartPoint().getX(), rEdge.getStartPoint().getY())); aBezierPolygon.append(aStartPolygon); } @@ -452,7 +452,7 @@ namespace basegfx utils::createScaleShearXRotateTranslateB2DHomMatrix( fHalfLineWidth, fHalfLineWidth, 0.0, - atan2(aTangentB.getY(), aTangentB.getX()) - F_PI2, + atan2(aTangentB.getY(), aTangentB.getX()) - M_PI_2, rEdge.getEndPoint().getX(), rEdge.getEndPoint().getY())); aBezierPolygon.append(aEndPolygon); } @@ -604,7 +604,7 @@ namespace basegfx utils::createScaleShearXRotateTranslateB2DHomMatrix( fHalfLineWidth, fHalfLineWidth, 0.0, - fAngle + F_PI2, + fAngle + M_PI_2, rEdge.getStartPoint().getX(), rEdge.getStartPoint().getY())); } else @@ -642,7 +642,7 @@ namespace basegfx utils::createScaleShearXRotateTranslateB2DHomMatrix( fHalfLineWidth, fHalfLineWidth, 0.0, - fAngle - F_PI2, + fAngle - M_PI_2, rEdge.getEndPoint().getX(), rEdge.getEndPoint().getY())); aEdgePolygon.append(aEndPolygon); } @@ -710,7 +710,7 @@ namespace basegfx { const double fAngle(fabs(rPerpendPrev.angle(rPerpendEdge))); - if((F_PI - fAngle) < fMiterMinimumAngle) + if((M_PI - fAngle) < fMiterMinimumAngle) { // fallback to bevel eJoin = B2DLineJoin::Bevel; @@ -851,13 +851,13 @@ namespace basegfx double fMiterMinimumAngle, basegfx::triangulator::B2DTriangleVector* pTriangles) { - if(fMaxAllowedAngle > F_PI2) + if(fMaxAllowedAngle > M_PI_2) { - fMaxAllowedAngle = F_PI2; + fMaxAllowedAngle = M_PI_2; } - else if(fMaxAllowedAngle < 0.01 * F_PI2) + else if(fMaxAllowedAngle < 0.01 * M_PI_2) { - fMaxAllowedAngle = 0.01 * F_PI2; + fMaxAllowedAngle = 0.01 * M_PI_2; } if(fMaxPartOfEdge > 1.0) @@ -869,13 +869,13 @@ namespace basegfx fMaxPartOfEdge = 0.01; } - if(fMiterMinimumAngle > F_PI) + if(fMiterMinimumAngle > M_PI) { - fMiterMinimumAngle = F_PI; + fMiterMinimumAngle = M_PI; } - else if(fMiterMinimumAngle < 0.01 * F_PI) + else if(fMiterMinimumAngle < 0.01 * M_PI) { - fMiterMinimumAngle = 0.01 * F_PI; + fMiterMinimumAngle = 0.01 * M_PI; } B2DPolygon aCandidate(rCandidate); @@ -935,7 +935,7 @@ namespace basegfx { const double fAngle(fabs(aTangentPrev.angle(aTangentEdge))); - if(fTools::equal(fAngle, F_PI)) + if(fTools::equal(fAngle, M_PI)) { // for half-circle production, fallback to positive // orientation diff --git a/basegfx/source/polygon/b2dpolygontools.cxx b/basegfx/source/polygon/b2dpolygontools.cxx index d4644a6f0606..ce62a95c020f 100644 --- a/basegfx/source/polygon/b2dpolygontools.cxx +++ b/basegfx/source/polygon/b2dpolygontools.cxx @@ -1572,8 +1572,8 @@ namespace basegfx::utils // and alternatives read document "ApproxCircleInfo.odt", attachment of bug tdf#121425. static double impDistanceBezierPointToControl(double fAngle) { - SAL_WARN_IF(fAngle < 0 || fAngle > F_PI2,"basegfx","angle not suitable for approximate circle"); - if (0 <= fAngle && fAngle <= F_PI2) + SAL_WARN_IF(fAngle < 0 || fAngle > M_PI_2,"basegfx","angle not suitable for approximate circle"); + if (0 <= fAngle && fAngle <= M_PI_2) { return 4.0/3.0 * ( tan(fAngle/4.0)); } @@ -1624,7 +1624,7 @@ namespace basegfx::utils B2DPolygon aRetval; const double fBowX((rRect.getWidth() / 2.0) * fRadiusX); const double fBowY((rRect.getHeight() / 2.0) * fRadiusY); - const double fKappa(impDistanceBezierPointToControl(F_PI2)); + const double fKappa(impDistanceBezierPointToControl(M_PI_2)); // create start point at bottom center if(!rtl::math::approxEqual(fOne, fRadiusX)) @@ -1723,8 +1723,8 @@ namespace basegfx::utils static B2DPolygon impCreateUnitCircle(sal_uInt32 nStartQuadrant) { B2DPolygon aUnitCircle; - const double fSegmentKappa = impDistanceBezierPointToControl(F_PI2 / STEPSPERQUARTER); - const B2DHomMatrix aRotateMatrix(createRotateB2DHomMatrix(F_PI2 / STEPSPERQUARTER)); + const double fSegmentKappa = impDistanceBezierPointToControl(M_PI_2 / STEPSPERQUARTER); + const B2DHomMatrix aRotateMatrix(createRotateB2DHomMatrix(M_PI_2 / STEPSPERQUARTER)); B2DPoint aPoint(1.0, 0.0); B2DPoint aForward(1.0, fSegmentKappa); @@ -1732,7 +1732,7 @@ namespace basegfx::utils if(nStartQuadrant != 0) { - const B2DHomMatrix aQuadrantMatrix(createRotateB2DHomMatrix(F_PI2 * (nStartQuadrant % 4))); + const B2DHomMatrix aQuadrantMatrix(createRotateB2DHomMatrix(M_PI_2 * (nStartQuadrant % 4))); aPoint *= aQuadrantMatrix; aBackward *= aQuadrantMatrix; aForward *= aQuadrantMatrix; @@ -1758,8 +1758,8 @@ namespace basegfx::utils { static auto const singleton = [] { B2DPolygon aUnitHalfCircle; - const double fSegmentKappa(impDistanceBezierPointToControl(F_PI2 / STEPSPERQUARTER)); - const B2DHomMatrix aRotateMatrix(createRotateB2DHomMatrix(F_PI2 / STEPSPERQUARTER)); + const double fSegmentKappa(impDistanceBezierPointToControl(M_PI_2 / STEPSPERQUARTER)); + const B2DHomMatrix aRotateMatrix(createRotateB2DHomMatrix(M_PI_2 / STEPSPERQUARTER)); B2DPoint aPoint(1.0, 0.0); B2DPoint aForward(1.0, fSegmentKappa); B2DPoint aBackward(1.0, -fSegmentKappa); @@ -1852,7 +1852,7 @@ namespace basegfx::utils else { const sal_uInt32 nSegments(STEPSPERQUARTER * 4); - const double fAnglePerSegment(F_PI2 / STEPSPERQUARTER); + const double fAnglePerSegment(M_PI_2 / STEPSPERQUARTER); const sal_uInt32 nStartSegment(sal_uInt32(fStart / fAnglePerSegment) % nSegments); const sal_uInt32 nEndSegment(sal_uInt32(fEnd / fAnglePerSegment) % nSegments); const double fSegmentKappa(impDistanceBezierPointToControl(fAnglePerSegment)); diff --git a/basegfx/source/polygon/b2dtrapezoid.cxx b/basegfx/source/polygon/b2dtrapezoid.cxx index 12dbd66fdf9e..0bfb8fb5705f 100644 --- a/basegfx/source/polygon/b2dtrapezoid.cxx +++ b/basegfx/source/polygon/b2dtrapezoid.cxx @@ -91,7 +91,7 @@ namespace basegfx::trapezoidhelper // get radiant; has to be in the range ]0.0 .. pi[, thus scale to full // sal_uInt32 range for maximum precision - const double fRadiant(atan2(getDeltaY(), getDeltaX()) * (SAL_MAX_UINT32 / F_PI)); + const double fRadiant(atan2(getDeltaY(), getDeltaX()) * (SAL_MAX_UINT32 / M_PI)); // convert to sal_uInt32 value const_cast< TrDeEdgeEntry* >(this)->mnSortValue = sal_uInt32(fRadiant); diff --git a/basegfx/source/polygon/b3dpolygontools.cxx b/basegfx/source/polygon/b3dpolygontools.cxx index 377b05802986..708417122abf 100644 --- a/basegfx/source/polygon/b3dpolygontools.cxx +++ b/basegfx/source/polygon/b3dpolygontools.cxx @@ -401,12 +401,12 @@ namespace basegfx::utils // transitions which value to choose const B3DRange aPlaneRange(getRange(rCandidate)); const B3DPoint aPlaneCenter(aPlaneRange.getCenter() - rCenter); - const double fXCenter(fOne - ((atan2(aPlaneCenter.getZ(), aPlaneCenter.getX()) + F_PI) / F_2PI)); + const double fXCenter(fOne - ((atan2(aPlaneCenter.getZ(), aPlaneCenter.getX()) + M_PI) / F_2PI)); for(a = 0; a < nPointCount; a++) { const B3DVector aVector(aRetval.getB3DPoint(a) - rCenter); - const double fY(fOne - ((atan2(aVector.getY(), aVector.getXZLength()) + F_PI2) / F_PI)); + const double fY(fOne - ((atan2(aVector.getY(), aVector.getXZLength()) + M_PI_2) / M_PI)); B2DPoint aTexCoor(aRetval.getTextureCoordinate(a)); if(fTools::equalZero(fY)) @@ -438,7 +438,7 @@ namespace basegfx::utils } else { - double fX(fOne - ((atan2(aVector.getZ(), aVector.getX()) + F_PI) / F_2PI)); + double fX(fOne - ((atan2(aVector.getZ(), aVector.getX()) + M_PI) / F_2PI)); // correct cartesian point coordinate dependent from center value if(fX > fXCenter + 0.5) diff --git a/basegfx/source/polygon/b3dpolypolygontools.cxx b/basegfx/source/polygon/b3dpolypolygontools.cxx index ad2dd5bb7979..2c7b3c1fc5a3 100644 --- a/basegfx/source/polygon/b3dpolypolygontools.cxx +++ b/basegfx/source/polygon/b3dpolypolygontools.cxx @@ -200,7 +200,7 @@ namespace basegfx::utils } // helper for getting the 3D Point from given cartesian coordinates. fHor is defined from - // [F_PI2 .. -F_PI2], fVer from [0.0 .. F_2PI] + // [M_PI_2 .. -M_PI_2], fVer from [0.0 .. F_2PI] static B3DPoint getPointFromCartesian(double fHor, double fVer) { const double fCosVer(cos(fVer)); @@ -235,8 +235,8 @@ namespace basegfx::utils const double fVerDiffPerStep((fVerStop - fVerStart) / static_cast<double>(nVerSeg)); const double fHorDiffPerStep((fHorStop - fHorStart) / static_cast<double>(nHorSeg)); bool bHorClosed(fTools::equal(fHorStop - fHorStart, F_2PI)); - bool bVerFromTop(fTools::equal(fVerStart, F_PI2)); - bool bVerToBottom(fTools::equal(fVerStop, -F_PI2)); + bool bVerFromTop(fTools::equal(fVerStart, M_PI_2)); + bool bVerToBottom(fTools::equal(fVerStop, -M_PI_2)); // create horizontal rings const sal_uInt32 nLoopVerInit(bVerFromTop ? 1 : 0); diff --git a/basegfx/test/B2DHomMatrixTest.cxx b/basegfx/test/B2DHomMatrixTest.cxx index 04201ca19c0c..bd6b1f8c8029 100644 --- a/basegfx/test/B2DHomMatrixTest.cxx +++ b/basegfx/test/B2DHomMatrixTest.cxx @@ -159,7 +159,7 @@ public: void rotate() { B2DHomMatrix mat; - mat.rotate(F_PI2); + mat.rotate(M_PI_2); CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE("rotate pi/2 yields exact matrix", 0.0, mat.get(0, 0), 1E-12); CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE("rotate pi/2 yields exact matrix", -1.0, mat.get(0, 1), @@ -172,7 +172,7 @@ public: 1E-12); CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE("rotate pi/2 yields exact matrix", 0.0, mat.get(1, 2), 1E-12); - mat.rotate(F_PI2); + mat.rotate(M_PI_2); CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE("rotate pi yields exact matrix", -1.0, mat.get(0, 0), 1E-12); CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE("rotate pi yields exact matrix", 0.0, mat.get(0, 1), @@ -185,7 +185,7 @@ public: 1E-12); CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE("rotate pi yields exact matrix", 0.0, mat.get(1, 2), 1E-12); - mat.rotate(F_PI2); + mat.rotate(M_PI_2); CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE("rotate 3/2 pi yields exact matrix", 0.0, mat.get(0, 0), 1E-12); CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE("rotate 3/2 pi yields exact matrix", 1.0, @@ -198,7 +198,7 @@ public: mat.get(1, 1), 1E-12); CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE("rotate 3/2 pi yields exact matrix", 0.0, mat.get(1, 2), 1E-12); - mat.rotate(F_PI2); + mat.rotate(M_PI_2); CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE("rotate 2 pi yields exact matrix", 1.0, mat.get(0, 0), 1E-12); CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE("rotate 2 pi yields exact matrix", 0.0, mat.get(0, 1), @@ -334,7 +334,7 @@ public: // are just the two rightmost values and uncritical static const double fSX(10.0); static const double fSY(12.0); - static const double fR(F_PI4); + static const double fR(M_PI_4); static const double fS(deg2rad(15.0)); // check all possible scaling combinations @@ -429,7 +429,7 @@ public: // cover special case of 180 degree rotation B2DHomMatrix aTest - = utils::createScaleShearXRotateTranslateB2DHomMatrix(6425, 3938, 0, F_PI, 10482, 4921); + = utils::createScaleShearXRotateTranslateB2DHomMatrix(6425, 3938, 0, M_PI, 10482, 4921); // decompose that matrix B2DTuple aDScale; B2DTuple aDTrans; @@ -442,7 +442,7 @@ public: 1E-12); CPPUNIT_ASSERT_EQUAL_MESSAGE("decompose: error test J1", 10482.0, aDTrans.getX()); CPPUNIT_ASSERT_EQUAL_MESSAGE("decompose: error test J1", 4921.0, aDTrans.getY()); - CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE("decompose: error test J1", F_PI, fDRot, 1E-12); + CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE("decompose: error test J1", M_PI, fDRot, 1E-12); } void testCreate_abcdef() diff --git a/basic/source/runtime/props.cxx b/basic/source/runtime/props.cxx index 838f6e569772..f3d84a0127b5 100644 --- a/basic/source/runtime/props.cxx +++ b/basic/source/runtime/props.cxx @@ -65,7 +65,7 @@ void SbRtl_Null(StarBASIC *, SbxArray & rPar, bool) rPar.Get(0)->PutNull(); } -void SbRtl_PI(StarBASIC*, SbxArray& rPar, bool) { rPar.Get(0)->PutDouble(F_PI); } +void SbRtl_PI(StarBASIC*, SbxArray& rPar, bool) { rPar.Get(0)->PutDouble(M_PI); } void SbRtl_True(StarBASIC*, SbxArray& rPar, bool) { rPar.Get(0)->PutBool(true); } diff --git a/canvas/source/vcl/canvashelper.cxx b/canvas/source/vcl/canvashelper.cxx index 80a0dc2a8fa6..1a2f7209562f 100644 --- a/canvas/source/vcl/canvashelper.cxx +++ b/canvas/source/vcl/canvashelper.cxx @@ -376,7 +376,7 @@ namespace vclcanvas double fMiterMinimumAngle; if (strokeAttributes.MiterLimit <= 1.0) { - fMiterMinimumAngle = F_PI2; + fMiterMinimumAngle = M_PI_2; } else { diff --git a/chart2/source/controller/main/DragMethod_RotateDiagram.cxx b/chart2/source/controller/main/DragMethod_RotateDiagram.cxx index 7a9dbe91a476..b8a0b7d13fb5 100644 --- a/chart2/source/controller/main/DragMethod_RotateDiagram.cxx +++ b/chart2/source/controller/main/DragMethod_RotateDiagram.cxx @@ -114,9 +114,9 @@ void DragMethod_RotateDiagram::MoveSdrDrag(const Point& rPnt) Hide(); //calculate new angle - double fX = F_PI2 * static_cast<double>(rPnt.Y() - m_aStartPos.Y()) + double fX = M_PI_2 * static_cast<double>(rPnt.Y() - m_aStartPos.Y()) / (m_aReferenceRect.GetHeight() > 0 ? static_cast<double>(m_aReferenceRect.GetHeight()) : 1.0); - double fY = F_PI * static_cast<double>(rPnt.X() - m_aStartPos.X()) + double fY = M_PI * static_cast<double>(rPnt.X() - m_aStartPos.X()) / (m_aReferenceRect.GetWidth() > 0 ? static_cast<double>(m_aReferenceRect.GetWidth()) : 1.0); if( m_eRotationDirection != ROTATIONDIRECTION_Y ) diff --git a/chart2/source/tools/ThreeDHelper.cxx b/chart2/source/tools/ThreeDHelper.cxx index 8c48d359c7b4..0903459606bb 100644 --- a/chart2/source/tools/ThreeDHelper.cxx +++ b/chart2/source/tools/ThreeDHelper.cxx @@ -365,10 +365,10 @@ namespace double lcl_shiftAngleToIntervalMinusPiToPi( double fAngleRad ) { //valid range: ]-Pi,Pi] - while( fAngleRad<=-F_PI ) - fAngleRad+=(2*F_PI); - while( fAngleRad>F_PI ) - fAngleRad-=(2*F_PI); + while( fAngleRad<=-M_PI ) + fAngleRad+=(2*M_PI); + while( fAngleRad>M_PI ) + fAngleRad-=(2*M_PI); return fAngleRad; } @@ -417,25 +417,25 @@ void ThreeDHelper::convertElevationRotationDegToXYZAngleRad( //element 23 double f23 = cos(R)*sin(E); if(f23>0) - x = F_PI2; + x = M_PI_2; else - x = -F_PI2; + x = -M_PI_2; y = R; } else if( ( nRotationDeg == 90 || nRotationDeg == 270 ) && ( nElevationDeg == 90 || nElevationDeg == 270 ) ) { //cR==0 && cE==0 - z = F_PI2; + z = M_PI_2; if( sin(R)>0 ) - x = F_PI2; + x = M_PI_2; else - x = -F_PI2; + x = -M_PI_2; if( (sin(R)*sin(E))>0 ) y = 0.0; else - y = F_PI; + y = M_PI; } else if( (nRotationDeg == 0 || nRotationDeg == 180 ) && ( nElevationDeg == 0 || nElevationDeg == 180 ) ) @@ -452,14 +452,14 @@ void ThreeDHelper::convertElevationRotationDegToXYZAngleRad( z = 0.0; if( (sin(R)/cos(E))>0 ) - y = F_PI2; + y = M_PI_2; else - y = -F_PI2; + y = -M_PI_2; if( (cos(E))>0 ) x = 0; else - x = F_PI; + x = M_PI; } else if ( nElevationDeg == 0 || nElevationDeg == 180 ) { @@ -474,19 +474,19 @@ void ThreeDHelper::convertElevationRotationDegToXYZAngleRad( else if ( nElevationDeg == 90 || nElevationDeg == 270 ) { //sR!=0 cR!=0 cE==0 - //element 12 + 22 --> y=0 or F_PI and x=+-F_PI/2 + //element 12 + 22 --> y=0 or M_PI and x=+-M_PI/2 //-->element 13/23: z = atan(sin(R)/(cos(R)*sin(E))); //use element 13 for sign for x if( (sin(R)*sin(z))>0.0 ) - x = F_PI2; + x = M_PI_2; else - x = -F_PI2; + x = -M_PI_2; //use element 21 for y if( (sin(R)*sin(E)*sin(z))>0.0) y = 0.0; else - y = F_PI; + y = M_PI; } else if ( nRotationDeg == 0 || nRotationDeg == 180 ) { @@ -501,10 +501,10 @@ void ThreeDHelper::convertElevationRotationDegToXYZAngleRad( else if (nRotationDeg == 90 || nRotationDeg == 270) { //sE!=0 cE!=0 cR==0 - //z = +- F_PI/2; - //x = +- F_PI/2; - z = F_PI2; - x = F_PI2; + //z = +- M_PI/2; + //x = +- M_PI/2; + z = M_PI_2; + x = M_PI_2; double sR = sin(R); if( sR<0.0 ) x *= -1.0; //different signs for x and z @@ -555,7 +555,7 @@ void ThreeDHelper::convertElevationRotationDegToXYZAngleRad( if( (f22a*f22b)<0.0 ) { y *= -1; - x=(F_PI-x); + x=(M_PI-x); } } else @@ -567,7 +567,7 @@ void ThreeDHelper::convertElevationRotationDegToXYZAngleRad( if( (f22a*f22b)<0.0 ) { y *= -1; - x=(F_PI-x); + x=(M_PI-x); } } } @@ -607,14 +607,14 @@ void ThreeDHelper::convertXYZAngleRadToElevationRotationDeg( if( f11 > 0 ) R = 0.0; else - R = F_PI; + R = M_PI; //element 23 double f23 = cos(z)*sin(x) / cos(R); if( f23 > 0 ) - E = F_PI2; + E = M_PI_2; else - E = -F_PI2; + E = -M_PI_2; } else if( lcl_isCosZero(z) ) { @@ -624,16 +624,16 @@ void ThreeDHelper::convertXYZAngleRadToElevationRotationDeg( double f13 = sin(x)*sin(z); //element 13+11 if( f13 > 0 ) - R = F_PI2; + R = M_PI_2; else - R = -F_PI2; + R = -M_PI_2; //element 21 double f21 = cos(y)*sin(z) / sin(R); if( f21 > 0 ) - E = F_PI2; + E = M_PI_2; else - E = -F_PI2; + E = -M_PI_2; } else { @@ -643,14 +643,14 @@ void ThreeDHelper::convertXYZAngleRadToElevationRotationDeg( R = atan( f13/f11 ); if(f11<0) - R+=F_PI; + R+=M_PI; //element 23 double f23 = cos(z)*sin(x); if( f23/cos(R) > 0 ) - E = F_PI2; + E = M_PI_2; else - E = -F_PI2; + E = -M_PI_2; } } else if( lcl_isSinZero(x) ) @@ -660,13 +660,13 @@ void ThreeDHelper::convertXYZAngleRadToElevationRotationDeg( if( f11 > 0 ) R = 0.0; else - R = F_PI; + R = M_PI; double f22 = cos(x)*cos(z); if( f22 > 0 ) E = 0.0; else - E = F_PI; + E = M_PI; } else if( lcl_isSinZero(z) ) { @@ -675,14 +675,14 @@ void ThreeDHelper::convertXYZAngleRadToElevationRotationDeg( if( f11 > 0 ) R = 0.0; else - R = F_PI; + R = M_PI; //element 22 && 23 double f22 = cos(x)*cos(z); double f23 = cos(z)*sin(x); E = atan( f23/(f22*cos(R)) ); if( (f22*cos(E))<0 ) - E+=F_PI; + E+=M_PI; } else if( lcl_isCosZero(z) ) { @@ -690,16 +690,16 @@ void ThreeDHelper::convertXYZAngleRadToElevationRotationDeg( double f13 = sin(x)*sin(z); //element 13+11 if( f13 > 0 ) - R = F_PI2; + R = M_PI_2; else - R = -F_PI2; + R = -M_PI_2; //element 21+22 double f21 = cos(y)*sin(z); if( f21/sin(R) > 0 ) - E = F_PI2; + E = M_PI_2; else - E = -F_PI2; + E = -M_PI_2; } else { @@ -707,7 +707,7 @@ void ThreeDHelper::convertXYZAngleRadToElevationRotationDeg( double f13 = sin(x)*sin(z); R = atan( f13/f11 ); if( (f11*cos(R))<0.0 ) - R+=F_PI; + R+=M_PI; double f22 = cos(x)*cos(z); if( !lcl_isCosZero(R) ) @@ -715,7 +715,7 @@ void ThreeDHelper::convertXYZAngleRadToElevationRotationDeg( else E = atan( cos(y)*sin(z) /( f22*sin(R) ) ); if( (f22*cos(E))<0 ) - E+=F_PI; + E+=M_PI; } } else if( lcl_isCosZero(y) ) @@ -724,15 +724,15 @@ void ThreeDHelper::convertXYZAngleRadToElevationRotationDeg( double f13 = sin(x)*sin(z)+cos(x)*cos(z)*sin(y); if( f13 >= 0 ) - R = F_PI2; + R = M_PI_2; else - R = -F_PI2; + R = -M_PI_2; double f22 = cos(x)*cos(z)+sin(x)*sin(y)*sin(z); if( f22 >= 0 ) E = 0.0; else - E = F_PI; + E = M_PI; } else if( lcl_isSinZero(x) ) { @@ -744,13 +744,13 @@ void ThreeDHelper::convertXYZAngleRadToElevationRotationDeg( R = atan( f13/f11 ); //R = asin(f13); if( f11<0 ) - R+=F_PI; + R+=M_PI; double f22 = cos(x)*cos(z); if( f22>0 ) E = 0.0; else - E = F_PI; + E = M_PI; } else if( lcl_isCosZero(z) ) { @@ -772,14 +772,14 @@ void ThreeDHelper::convertXYZAngleRadToElevationRotationDeg( R = atan( f13/f11 ); if( f11<0 ) - R+=F_PI; + R+=M_PI; double f21 = cos(y)*sin(z); double f22 = cos(x)*cos(z); E = atan(f21/(f22*sin(R)) ); if( (f22*cos(E))<0.0 ) - E+=F_PI; + E+=M_PI; } } else if( lcl_isCosZero(x) ) @@ -789,23 +789,23 @@ void ThreeDHelper::convertXYZAngleRadToElevationRotationDeg( if( lcl_isSinZero(z) ) { //cosY!=0 sinY!=0 cosX=0 sinZ=0 - R=0;//13 -> R=0 or F_PI + R=0;//13 -> R=0 or M_PI if( f11<0.0 ) - R=F_PI; - E=F_PI2;//22 -> E=+-F_PI/2 + R=M_PI; + E=M_PI_2;//22 -> E=+-M_PI/2 //use element 11 and 23 for sign double f23 = cos(z)*sin(x); if( (f11*f23*sin(E))<0.0 ) - E=-F_PI2; + E=-M_PI_2; } else if( lcl_isCosZero(z) ) { //cosY!=0 sinY!=0 cosX=0 cosZ=0 //element 11 & 13: if( (sin(x)*sin(z))>0.0 ) - R=F_PI2; + R=M_PI_2; else - R=-F_PI2; + R=-M_PI_2; //element 22: E=acos( sin(x)*sin(y)*sin(z)); //use element 21 for sign: @@ -819,7 +819,7 @@ void ThreeDHelper::convertXYZAngleRadToElevationRotationDeg( R = atan( sin(x)*sin(z)/(cos(y)*cos(z)) ); //use 13 for 'sign' if( (sin(x)*sin(z))<0.0 ) - R += F_PI; + R += M_PI; //element 22 E = acos(sin(x)*sin(y)*sin(z) ); //use 21 for sign @@ -848,12 +848,12 @@ void ThreeDHelper::convertXYZAngleRadToElevationRotationDeg( R=atan(-cos(y)/(cos(x)*sin(y))); //use element 13 for 'sign' if( (sin(x)*sin(z)*sin(R))<0.0 ) - R+=F_PI; + R+=M_PI; //element 21/22 E=atan( cos(y)*sin(z)/(sin(R)*sin(x)*sin(y)*sin(z)) ); //use element 23 for 'sign' if( (-cos(x)*sin(y)*sin(z)*cos(R)*sin(E))<0.0 ) - E+=F_PI; + E+=M_PI; } else { @@ -862,13 +862,13 @@ void ThreeDHelper::convertXYZAngleRadToElevationRotationDeg( double f13 = sin(x)*sin(z)+cos(x)*cos(z)*sin(y); R = atan( f13/ f11 ); if(f11<0.0) - R+=F_PI; + R+=M_PI; double f22 = cos(x)*cos(z)+sin(x)*sin(y)*sin(z); double f23 = cos(x)*sin(y)*sin(z)-cos(z)*sin(x); //23/22: E = atan( -1.0*f23/(f22*cos(R)) ); if(f22<0.0) - E+=F_PI; + E+=M_PI; } rnElevationDeg = basegfx::fround(basegfx::rad2deg(E)); @@ -922,11 +922,11 @@ void ThreeDHelper::getRotationAngleFromDiagram( rfYAngleRad = lcl_shiftAngleToIntervalMinusPiToPi(aRotation.getY()); rfZAngleRad = lcl_shiftAngleToIntervalMinusPiToPi(aRotation.getZ()); - if(rfZAngleRad<-F_PI2 || rfZAngleRad>F_PI2) + if(rfZAngleRad<-M_PI_2 || rfZAngleRad>M_PI_2) { - rfZAngleRad-=F_PI; - rfXAngleRad-=F_PI; - rfYAngleRad=(F_PI-rfYAngleRad); + rfZAngleRad-=M_PI; + rfXAngleRad-=M_PI; + rfYAngleRad=(M_PI-rfYAngleRad); rfXAngleRad = lcl_shiftAngleToIntervalMinusPiToPi(rfXAngleRad); rfYAngleRad = lcl_shiftAngleToIntervalMinusPiToPi(rfYAngleRad); @@ -1247,7 +1247,7 @@ void ThreeDHelper::setDefaultRotation( const uno::Reference< beans::XPropertySet ::basegfx::B3DHomMatrix aSceneRotation; if( bPieOrDonut ) - aSceneRotation.rotate( -F_PI/3.0, 0, 0 ); + aSceneRotation.rotate( -M_PI/3.0, 0, 0 ); xSceneProperties->setPropertyValue( "D3DTransformMatrix", uno::Any( BaseGFXHelper::B3DHomMatrixToHomogenMatrix( aSceneRotation ))); } diff --git a/chart2/source/view/axes/Tickmarks.cxx b/chart2/source/view/axes/Tickmarks.cxx index ba4ad8073eb0..d10583c1b77d 100644 --- a/chart2/source/view/axes/Tickmarks.cxx +++ b/chart2/source/view/axes/Tickmarks.cxx @@ -175,7 +175,7 @@ bool TickFactory2D::isHorizontalAxis() const // for skew axes compare angle with horizontal vector double fInclination = std::abs(B2DVector(m_aAxisEndScreenPosition2D-m_aAxisStartScreenPosition2D).angle(B2DVector(1.0, 0.0))); - return fInclination < F_PI4 || fInclination > (F_PI-F_PI4); + return fInclination < M_PI_4 || fInclination > (M_PI-M_PI_4); } bool TickFactory2D::isVerticalAxis() const { @@ -187,7 +187,7 @@ bool TickFactory2D::isVerticalAxis() const // for skew axes compare angle with vertical vector double fInclination = std::abs(B2DVector(m_aAxisEndScreenPosition2D-m_aAxisStartScreenPosition2D).angle(B2DVector(0.0, -1.0))); - return fInclination < F_PI4 || fInclination > (F_PI-F_PI4); + return fInclination < M_PI_4 || fInclination > (M_PI-M_PI_4); } //static sal_Int32 TickFactory2D::getTickScreenDistance( TickIter& rIter ) diff --git a/chart2/source/view/charttypes/BubbleChart.cxx b/chart2/source/view/charttypes/BubbleChart.cxx index d5141be5cb58..aa1431516c54 100644 --- a/chart2/source/view/charttypes/BubbleChart.cxx +++ b/chart2/source/view/charttypes/BubbleChart.cxx @@ -107,8 +107,8 @@ drawing::Direction3D BubbleChart::transformToScreenBubbleSize( double fLogicSize double fMaxSize = m_fMaxLogicBubbleSize; - double fMaxRadius = sqrt( fMaxSize / F_PI ); - double fRadius = sqrt( fLogicSize / F_PI ); + double fMaxRadius = sqrt( fMaxSize / M_PI ); + double fRadius = sqrt( fLogicSize / M_PI ); aRet.DirectionX = m_fBubbleSizeFactorToScreen * fRadius / fMaxRadius; aRet.DirectionY = aRet.DirectionX; diff --git a/chart2/source/view/main/LabelPositionHelper.cxx b/chart2/source/view/main/LabelPositionHelper.cxx index 798c6562e1f6..8f36943ade7a 100644 --- a/chart2/source/view/main/LabelPositionHelper.cxx +++ b/chart2/source/view/main/LabelPositionHelper.cxx @@ -130,7 +130,7 @@ void lcl_correctRotation_Left( double& rfXCorrection, double& rfYCorrection } else if( fAnglePositiveDegree<= 180.0 ) { - double beta = fAnglePi-F_PI2; + double beta = fAnglePi-M_PI_2; rfXCorrection = -aSize.Width *std::sin( beta ) -aSize.Height *std::cos( beta )/2.0; if( bRotateAroundCenter ) @@ -140,7 +140,7 @@ void lcl_correctRotation_Left( double& rfXCorrection, double& rfYCorrection } else if( fAnglePositiveDegree<= 270.0 ) { - double beta = fAnglePi - F_PI; + double beta = fAnglePi - M_PI; rfXCorrection = -aSize.Width *std::cos( beta ) -aSize.Height*std::sin( beta )/2.0; if( bRotateAroundCenter ) @@ -150,7 +150,7 @@ void lcl_correctRotation_Left( double& rfXCorrection, double& rfYCorrection } else { - double beta = 2*F_PI - fAnglePi; + double beta = 2*M_PI - fAnglePi; rfXCorrection = -aSize.Height*std::sin( beta )/2.0; if( bRotateAroundCenter ) rfYCorrection = aSize.Width*std::sin( beta )/2.0; @@ -173,7 +173,7 @@ void lcl_correctRotation_Right( double& rfXCorrection, double& rfYCorrection } else if( fAnglePositiveDegree<= 180.0 ) { - double beta = F_PI - fAnglePi; + double beta = M_PI - fAnglePi; rfXCorrection = aSize.Width *std::cos( beta ) + aSize.Height*std::sin( beta )/2.0; if( bRotateAroundCenter ) @@ -183,7 +183,7 @@ void lcl_correctRotation_Right( double& rfXCorrection, double& rfYCorrection } else if( fAnglePositiveDegree<= 270.0 ) { - double beta = 3*F_PI2 - fAnglePi; + double beta = 3*M_PI_2 - fAnglePi; rfXCorrection = aSize.Width *std::sin( beta ) +aSize.Height*std::cos( beta )/2.0; if( bRotateAroundCenter ) @@ -193,9 +193,9 @@ void lcl_correctRotation_Right( double& rfXCorrection, double& rfYCorrection } else { - rfXCorrection = aSize.Height*std::sin( 2*F_PI - fAnglePi )/2.0; + rfXCorrection = aSize.Height*std::sin( 2*M_PI - fAnglePi )/2.0; if( bRotateAroundCenter ) - rfYCorrection = -aSize.Width*std::sin( 2*F_PI - fAnglePi )/2.0; + rfYCorrection = -aSize.Width*std::sin( 2*M_PI - fAnglePi )/2.0; } } @@ -216,7 +216,7 @@ void lcl_correctRotation_Top( double& rfXCorrection, double& rfYCorrection } else if( fAnglePositiveDegree<= 180.0 ) { - double beta = fAnglePi - F_PI2; + double beta = fAnglePi - M_PI_2; rfXCorrection = aSize.Height*std::cos( beta )/2.0; if( !bRotateAroundCenter ) rfXCorrection -= aSize.Width*std::sin( beta )/2.0; @@ -225,7 +225,7 @@ void lcl_correctRotation_Top( double& rfXCorrection, double& rfYCorrection } else if( fAnglePositiveDegree<= 270.0 ) { - double beta = fAnglePi - F_PI; + double beta = fAnglePi - M_PI; rfXCorrection = -aSize.Height *std::sin( beta )/2.0; if( !bRotateAroundCenter ) rfXCorrection += aSize.Width *std::cos( beta )/2.0; @@ -258,7 +258,7 @@ void lcl_correctRotation_Bottom( double& rfXCorrection, double& rfYCorrection } else if( fAnglePositiveDegree<= 180.0 ) { - double beta = fAnglePi-F_PI2; + double beta = fAnglePi-M_PI_2; rfXCorrection = -aSize.Height*std::cos( beta )/2.0; if( !bRotateAroundCenter ) rfXCorrection += aSize.Width *std::sin( beta )/2.0; @@ -267,7 +267,7 @@ void lcl_correctRotation_Bottom( double& rfXCorrection, double& rfYCorrection } else if( fAnglePositiveDegree<= 270.0 ) { - double beta = 3*F_PI2 - fAnglePi; + double beta = 3*M_PI_2 - fAnglePi; rfXCorrection = aSize.Height*std::cos( beta )/2.0; if( !bRotateAroundCenter ) rfXCorrection -= aSize.Width *std::sin( beta )/2.0; @@ -276,7 +276,7 @@ void lcl_correctRotation_Bottom( double& rfXCorrection, double& rfYCorrection } else { - double beta = 2*F_PI - fAnglePi; + double beta = 2*M_PI - fAnglePi; rfXCorrection = aSize.Height*std::sin( beta )/2.0; if( !bRotateAroundCenter ) rfXCorrection += aSize.Width*std::cos( beta )/2.0; @@ -298,14 +298,14 @@ void lcl_correctRotation_Left_Top( double& rfXCorrection, double& rfYCorrection } else if( fAnglePositiveDegree<= 180.0 ) { - double beta = fAnglePi-F_PI2; + double beta = fAnglePi-M_PI_2; rfXCorrection = -aSize.Width*std::sin( beta ); rfYCorrection = -aSize.Height*std::sin( beta ) -aSize.Width*std::cos( beta ); } else if( fAnglePositiveDegree<= 270.0 ) { - double beta = 3*F_PI2 - fAnglePi; + double beta = 3*M_PI_2 - fAnglePi; rfXCorrection = -aSize.Height*std::cos( beta ) -aSize.Width*std::sin( beta ); rfYCorrection = -aSize.Height*std::sin( beta ); @@ -330,14 +330,14 @@ void lcl_correctRotation_Left_Bottom( double& rfXCorrection, double& rfYCorrecti } else if( fAnglePositiveDegree<= 180.0 ) { - double beta = fAnglePi-F_PI2; + double beta = fAnglePi-M_PI_2; rfXCorrection = -aSize.Width*std::sin( beta ) -aSize.Height*std::cos( beta ); rfYCorrection = aSize.Height*std::sin( beta ); } else if( fAnglePositiveDegree<= 270.0 ) { - double beta = 3*F_PI2 - fAnglePi; + double beta = 3*M_PI_2 - fAnglePi; rfXCorrection = -aSize.Width*std::sin( beta ); rfYCorrection = aSize.Width*std::cos( beta ) +aSize.Height*std::sin( beta ); @@ -362,14 +362,14 @@ void lcl_correctRotation_Right_Top( double& rfXCorrection, double& rfYCorrection } else if( fAnglePositiveDegree<= 180.0 ) { - double beta = fAnglePi-F_PI2; + double beta = fAnglePi-M_PI_2; rfXCorrection = aSize.Width*std::sin( beta ) +aSize.Height*std::cos( beta ); rfYCorrection = -aSize.Height*std::sin( beta ); } else if( fAnglePositiveDegree<= 270.0 ) { - double beta = 3*F_PI2 - fAnglePi; + double beta = 3*M_PI_2 - fAnglePi; rfXCorrection = aSize.Width*std::sin( beta ); rfYCorrection = -aSize.Width*std::cos( beta ) -aSize.Height*std::sin( beta ); @@ -394,14 +394,14 @@ void lcl_correctRotation_Right_Bottom( double& rfXCorrection, double& rfYCorrect } else if( fAnglePositiveDegree<= 180.0 ) { - double beta = fAnglePi-F_PI2; + double beta = fAnglePi-M_PI_2; rfXCorrection = aSize.Width*std::sin( beta ); rfYCorrection = aSize.Height*std::sin( beta ) +aSize.Width*std::cos( beta ); } else if( fAnglePositiveDegree<= 270.0 ) { - double beta = 3*F_PI2 - fAnglePi; + double beta = 3*M_PI_2 - fAnglePi; rfXCorrection = aSize.Height*std::cos( beta ) +aSize.Width*std::sin( beta ); rfYCorrection = aSize.Height*std::sin( beta ); diff --git a/chart2/source/view/main/ShapeFactory.cxx b/chart2/source/view/main/ShapeFactory.cxx index 94ada8d02727..fe9bfe783615 100644 --- a/chart2/source/view/main/ShapeFactory.cxx +++ b/chart2/source/view/main/ShapeFactory.cxx @@ -426,7 +426,7 @@ uno::Reference<drawing::XShape> //Matrix for position basegfx::B3DHomMatrix aHomMatrix; if (nRotateZAngleHundredthDegree != 0) - aHomMatrix.rotate(0.0, 0.0, -nRotateZAngleHundredthDegree / 18000.00 * F_PI); + aHomMatrix.rotate(0.0, 0.0, -nRotateZAngleHundredthDegree / 18000.00 * M_PI); aHomMatrix.translate(rPosition.PositionX, rPosition.PositionY, rPosition.PositionZ - (fDepth / 2.0)); @@ -669,7 +669,7 @@ uno::Reference<drawing::XShape> //Matrix for position basegfx::B3DHomMatrix aHomMatrix; if (nRotateZAngleHundredthDegree != 0) - aHomMatrix.rotate(0.0,0.0,-nRotateZAngleHundredthDegree/18000.00*F_PI); + aHomMatrix.rotate(0.0,0.0,-nRotateZAngleHundredthDegree/18000.00*M_PI); //stretch the symmetric objects to given depth aHomMatrix.scale(1.0,1.0,rSize.DirectionZ/rSize.DirectionX); aHomMatrix.translate(rPosition.PositionX, rPosition.PositionY, rPosition.PositionZ); @@ -895,7 +895,7 @@ uno::Reference< drawing::XShape > ::basegfx::B2DHomMatrix aTransformationFromUnitCircle( IgnoreZ( HomogenMatrixToB3DHomMatrix(rUnitCircleToScene) ) ); aTransformationFromUnitCircle.translate(rOffset.DirectionX,rOffset.DirectionY); - const double fAngleSubdivisionRadian = F_PI/10.0; + const double fAngleSubdivisionRadian = M_PI/10.0; drawing::PolyPolygonBezierCoords aCoords = getRingBezierCoords(fUnitCircleInnerRadius, fUnitCircleOuterRadius, @@ -948,7 +948,7 @@ uno::Reference< drawing::XShape > ::basegfx::B2DHomMatrix aTransformationFromUnitCircle( IgnoreZ( HomogenMatrixToB3DHomMatrix(rUnitCircleToScene) ) ); aTransformationFromUnitCircle.translate(rOffset.DirectionX,rOffset.DirectionY); - const double fAngleSubdivisionRadian = F_PI/32.0; + const double fAngleSubdivisionRadian = M_PI/32.0; drawing::PolyPolygonBezierCoords aCoords = getRingBezierCoords(fUnitCircleInnerRadius, fUnitCircleOuterRadius, diff --git a/chart2/source/view/main/VTitle.cxx b/chart2/source/view/main/VTitle.cxx index 79d5d7a28256..44c2556ad989 100644 --- a/chart2/source/view/main/VTitle.cxx +++ b/chart2/source/view/main/VTitle.cxx @@ -86,7 +86,7 @@ void VTitle::changePosition( const awt::Point& rPos ) //set position matrix //the matrix needs to be set at the end behind autogrow and such position influencing properties ::basegfx::B2DHomMatrix aM; - aM.rotate( -m_fRotationAngleDegree*F_PI/180.0 );//#i78696#->#i80521# + aM.rotate( -m_fRotationAngleDegree*M_PI/180.0 );//#i78696#->#i80521# aM.translate( m_nXPos, m_nYPos); xShapeProp->setPropertyValue( "Transformation", uno::Any( B2DHomMatrixToHomogenMatrix3(aM) ) ); } diff --git a/cppcanvas/source/mtfrenderer/implrenderer.cxx b/cppcanvas/source/mtfrenderer/implrenderer.cxx index 3fb31a79ee73..7f367cb9fe40 100644 --- a/cppcanvas/source/mtfrenderer/implrenderer.cxx +++ b/cppcanvas/source/mtfrenderer/implrenderer.cxx @@ -768,7 +768,7 @@ namespace cppcanvas::internal if( nFontAngle != 0 ) { // set to unity transform rotated by font angle - const double nAngle( nFontAngle * (F_PI / 1800.0) ); + const double nAngle( nFontAngle * (M_PI / 1800.0) ); o_rFontRotation = -nAngle; } else diff --git a/drawinglayer/source/primitive2d/fillhatchprimitive2d.cxx b/drawinglayer/source/primitive2d/fillhatchprimitive2d.cxx index b01f8d76222a..49b26cb919b0 100644 --- a/drawinglayer/source/primitive2d/fillhatchprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/fillhatchprimitive2d.cxx @@ -65,7 +65,7 @@ namespace drawinglayer::primitive2d getDefinitionRange(), getOutputRange(), fDistance, - fAngle - F_PI4); + fAngle - M_PI_4); aHatch.appendTransformations(aMatrices); @@ -78,7 +78,7 @@ namespace drawinglayer::primitive2d getDefinitionRange(), getOutputRange(), fDistance, - fAngle - F_PI2); + fAngle - M_PI_2); aHatch.appendTransformations(aMatrices); diff --git a/drawinglayer/source/primitive2d/textlayoutdevice.cxx b/drawinglayer/source/primitive2d/textlayoutdevice.cxx index 38a14e927005..a6e209a577c6 100644 --- a/drawinglayer/source/primitive2d/textlayoutdevice.cxx +++ b/drawinglayer/source/primitive2d/textlayoutdevice.cxx @@ -395,7 +395,7 @@ vcl::Font getVclFontFromFontAttribute(const attribute::FontAttribute& rFontAttri // handle FontRotation (if defined) if (!basegfx::fTools::equalZero(fFontRotation)) { - sal_Int16 aRotate10th(static_cast<sal_Int16>(fFontRotation * (-1800.0 / F_PI))); + sal_Int16 aRotate10th(static_cast<sal_Int16>(fFontRotation * (-1800.0 / M_PI))); aRetval.SetOrientation(Degree10(aRotate10th % 3600)); } diff --git a/drawinglayer/source/primitive2d/textprimitive2d.cxx b/drawinglayer/source/primitive2d/textprimitive2d.cxx index b86e7acc20e7..4e584f2b6e92 100644 --- a/drawinglayer/source/primitive2d/textprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/textprimitive2d.cxx @@ -101,7 +101,7 @@ void TextSimplePortionPrimitive2D::getTextOutlinesAndTransformation( if (basegfx::fTools::less(aScale.getX(), 0.0) && basegfx::fTools::less(aScale.getY(), 0.0)) { aScale = basegfx::absolute(aScale); - fRotate += F_PI; + fRotate += M_PI; } // for the TextLayouterDevice, it is necessary to have a scaling representing diff --git a/drawinglayer/source/primitive3d/hatchtextureprimitive3d.cxx b/drawinglayer/source/primitive3d/hatchtextureprimitive3d.cxx index 59098d3cd3ef..a699f71706bb 100644 --- a/drawinglayer/source/primitive3d/hatchtextureprimitive3d.cxx +++ b/drawinglayer/source/primitive3d/hatchtextureprimitive3d.cxx @@ -142,7 +142,7 @@ namespace drawinglayer::primitive3d aOutlineRange, aOutlineRange, getHatch().getDistance(), - fAngle - F_PI4); + fAngle - M_PI_4); aHatch.appendTransformations(aMatrices); @@ -155,7 +155,7 @@ namespace drawinglayer::primitive3d aOutlineRange, aOutlineRange, getHatch().getDistance(), - fAngle - F_PI2); + fAngle - M_PI_2); aHatch.appendTransformations(aMatrices); diff --git a/drawinglayer/source/primitive3d/polygontubeprimitive3d.cxx b/drawinglayer/source/primitive3d/polygontubeprimitive3d.cxx index 8065ad73e54f..50aae077d2ba 100644 --- a/drawinglayer/source/primitive3d/polygontubeprimitive3d.cxx +++ b/drawinglayer/source/primitive3d/polygontubeprimitive3d.cxx @@ -234,7 +234,7 @@ namespace drawinglayer::primitive3d nSegments, nVerSeg, true, - F_PI2, 0.0, + M_PI_2, 0.0, 0.0, F_2PI)); const sal_uInt32 nCount(aSphere.count()); @@ -244,7 +244,7 @@ namespace drawinglayer::primitive3d // forget to transform normals, too basegfx::B3DHomMatrix aSphereTrans; - aSphereTrans.rotate(0.0, 0.0, F_PI2); + aSphereTrans.rotate(0.0, 0.0, M_PI_2); aSphere.transform(aSphereTrans); aSphere.transformNormals(aSphereTrans); @@ -301,7 +301,7 @@ namespace drawinglayer::primitive3d if(nHorSeg) { // create half-sphere - const basegfx::B3DPolyPolygon aSphere(basegfx::utils::createUnitSphereFillPolyPolygon(nHorSeg, nVerSeg, true, F_PI2, -F_PI2, 0.0, fAngle)); + const basegfx::B3DPolyPolygon aSphere(basegfx::utils::createUnitSphereFillPolyPolygon(nHorSeg, nVerSeg, true, M_PI_2, -M_PI_2, 0.0, fAngle)); for(sal_uInt32 a(0); a < aSphere.count(); a++) { @@ -331,13 +331,13 @@ namespace drawinglayer::primitive3d } } - const double fInc(F_PI / static_cast<double>(nVerSeg)); + const double fInc(M_PI / static_cast<double>(nVerSeg)); const double fSin(sin(-fAngle)); const double fCos(cos(-fAngle)); const bool bMiter(basegfx::B2DLineJoin::Miter == aLineJoin); const double fMiterSin(bMiter ? sin(-(fAngle/2.0)) : 0.0); const double fMiterCos(bMiter ? cos(-(fAngle/2.0)) : 0.0); - double fPos(-F_PI2); + double fPos(-M_PI_2); basegfx::B3DPoint aPointOnXY, aPointRotY, aNextPointOnXY, aNextPointRotY; basegfx::B3DPoint aCurrMiter, aNextMiter; basegfx::B3DPolygon aNewPolygon, aMiterPolygon; @@ -611,7 +611,7 @@ using namespace com::sun::star; if(!basegfx::fTools::equalZero(fCross)) { // line connect non-parallel, aBack, aForw, use getLineJoin() - const double fAngle(acos(aBack.scalar(aForw) / (fForwLen * aBack.getLength()))); // 0.0 .. F_PI2 + const double fAngle(acos(aBack.scalar(aForw) / (fForwLen * aBack.getLength()))); // 0.0 .. M_PI_2 Primitive3DContainer aNewList( getLineJoinSegments( nSegments, @@ -629,8 +629,8 @@ using namespace com::sun::star; // create trans by rotating unit sphere with angle 90 degrees around Y, then 180-fRot in X. // Also apply usual scaling and translation basegfx::B3DHomMatrix aSphereTrans; - aSphereTrans.rotate(0.0, F_PI2, 0.0); - aSphereTrans.rotate(F_PI - fRotInYZ, 0.0, 0.0); + aSphereTrans.rotate(0.0, M_PI_2, 0.0); + aSphereTrans.rotate(M_PI - fRotInYZ, 0.0, 0.0); aSphereTrans *= aRotVector; aSphereTrans.scale(getRadius(), getRadius(), getRadius()); aSphereTrans.translate(aCurr.getX(), aCurr.getY(), aCurr.getZ()); @@ -655,7 +655,7 @@ using namespace com::sun::star; basegfx::B3DHomMatrix aBackCapTrans; // Mirror (line end) and radius scale - aBackCapTrans.rotate(0.0, F_PI, 0.0); + aBackCapTrans.rotate(0.0, M_PI, 0.0); aBackCapTrans.scale(getRadius(), getRadius(), getRadius()); if(bLineCapSquare && bLast) diff --git a/drawinglayer/source/primitive3d/sdrextrudeprimitive3d.cxx b/drawinglayer/source/primitive3d/sdrextrudeprimitive3d.cxx index 10ba09e41b07..919fbcf5ab4a 100644 --- a/drawinglayer/source/primitive3d/sdrextrudeprimitive3d.cxx +++ b/drawinglayer/source/primitive3d/sdrextrudeprimitive3d.cxx @@ -234,7 +234,7 @@ namespace drawinglayer::primitive3d // take each angle which deviates more than 10% from going straight as // special edge. This will detect the two outer edges of pie segments, // but not always the center one (think about a near 180 degree pie) - if(F_PI - fabs(fAngle) > F_PI * 0.1) + if(M_PI - fabs(fAngle) > M_PI * 0.1) { if(nPointCount == nIndexA) { diff --git a/drawinglayer/source/processor2d/vclprocessor2d.cxx b/drawinglayer/source/processor2d/vclprocessor2d.cxx index b055ef229ce2..5d3f68d29a4a 100644 --- a/drawinglayer/source/processor2d/vclprocessor2d.cxx +++ b/drawinglayer/source/processor2d/vclprocessor2d.cxx @@ -119,7 +119,7 @@ void VclProcessor2D::RenderTextSimpleOrDecoratedPortionPrimitive2D( // be expressed as rotation by PI. Use this since the Font rendering will not // apply the negative scales in any form aFontScaling = basegfx::absolute(aFontScaling); - fRotate += F_PI; + fRotate += M_PI; } if (basegfx::fTools::more(aFontScaling.getX(), 0.0) diff --git a/drawinglayer/source/texture/texture3d.cxx b/drawinglayer/source/texture/texture3d.cxx index 4d5df6e52e60..0a83937991d2 100644 --- a/drawinglayer/source/texture/texture3d.cxx +++ b/drawinglayer/source/texture/texture3d.cxx @@ -285,7 +285,7 @@ namespace drawinglayer::texture aOutlineRange, aOutlineRange, rHatch.getDistance(), - fAngleA + F_PI2) ); + fAngleA + M_PI_2) ); } if(attribute::HatchStyle::Triple == rHatch.getStyle()) @@ -294,7 +294,7 @@ namespace drawinglayer::texture aOutlineRange, aOutlineRange, rHatch.getDistance(), - fAngleA + F_PI4) ); + fAngleA + M_PI_4) ); } } diff --git a/include/basegfx/numeric/ftools.hxx b/include/basegfx/numeric/ftools.hxx index 102e3b324942..7045695bf5fb 100644 --- a/include/basegfx/numeric/ftools.hxx +++ b/include/basegfx/numeric/ftools.hxx @@ -27,15 +27,6 @@ #include <algorithm> -#ifndef F_PI -#define F_PI M_PI -#endif -#ifndef F_PI2 -#define F_PI2 M_PI_2 -#endif -#ifndef F_PI4 -#define F_PI4 M_PI_4 -#endif #ifndef F_PI1800 #define F_PI1800 (M_PI/1800.0) #endif diff --git a/include/basegfx/polygon/b2dlinegeometry.hxx b/include/basegfx/polygon/b2dlinegeometry.hxx index 0e9f5241b866..e12dd74987f9 100644 --- a/include/basegfx/polygon/b2dlinegeometry.hxx +++ b/include/basegfx/polygon/b2dlinegeometry.hxx @@ -106,7 +106,7 @@ namespace basegfx::utils Allows to hand over the maximum allowed angle between an edge and it's control vectors. The smaller, the more subdivisions will be needed to create the filled geometry. Allowed range is cropped to - [F_PI2 .. 0.01 * F_PI2]. + [M_PI_2 .. 0.01 * M_PI_2]. @param fMaxPartOfEdge Allows to influence from with relative length of a control vector @@ -118,7 +118,7 @@ namespace basegfx::utils The minimum wanted angle between two edges when edge rounding is using miter. When an edge is smaller than this (tighter) the usual fallback to bevel is used. Allowed range is cropped - to [F_PI .. 0.01 * F_PI]. + to [M_PI .. 0.01 * M_PI]. Commit 51b5b93092d6231615de470c62494c24e54828a1 needs revert, we need the triangulation for X11 fat line drawing diff --git a/include/basegfx/polygon/b2dpolygontools.hxx b/include/basegfx/polygon/b2dpolygontools.hxx index 40a4027a507d..a2a3263a573d 100644 --- a/include/basegfx/polygon/b2dpolygontools.hxx +++ b/include/basegfx/polygon/b2dpolygontools.hxx @@ -263,7 +263,7 @@ namespace basegfx::utils */ BASEGFX_DLLPUBLIC B2DPolygon createPolygonFromCircle( const B2DPoint& rCenter, double fRadius ); - /// create half circle centered on (0,0) from [0 .. F_PI] + /// create half circle centered on (0,0) from [0 .. M_PI] B2DPolygon const & createHalfUnitCircle(); /** create a polygon which describes the unit circle and close it diff --git a/include/basegfx/polygon/b3dpolypolygontools.hxx b/include/basegfx/polygon/b3dpolypolygontools.hxx index cd51ac9e6524..4480f3266704 100644 --- a/include/basegfx/polygon/b3dpolypolygontools.hxx +++ b/include/basegfx/polygon/b3dpolypolygontools.hxx @@ -61,7 +61,7 @@ namespace basegfx::utils */ BASEGFX_DLLPUBLIC B3DPolyPolygon createUnitSpherePolyPolygon( sal_uInt32 nHorSeg, sal_uInt32 nVerSeg, - double fVerStart = F_PI2, double fVerStop = -F_PI2, + double fVerStart = M_PI_2, double fVerStop = -M_PI_2, double fHorStart = 0.0, double fHorStop = F_2PI); /** Create a 3D line polyPolygon from a B3DRange which defines a sphere with the given count of hor and ver segments. @@ -71,7 +71,7 @@ namespace basegfx::utils BASEGFX_DLLPUBLIC B3DPolyPolygon createSpherePolyPolygonFromB3DRange( const B3DRange& rRange, sal_uInt32 nHorSeg, sal_uInt32 nVerSeg, - double fVerStart = F_PI2, double fVerStop = -F_PI2, + double fVerStart = M_PI_2, double fVerStop = -M_PI_2, double fHorStart = 0.0, double fHorStop = F_2PI); /** same as createUnitSpherePolyPolygon, but creates filled polygons (closed and oriented) @@ -80,7 +80,7 @@ namespace basegfx::utils BASEGFX_DLLPUBLIC B3DPolyPolygon createUnitSphereFillPolyPolygon( sal_uInt32 nHorSeg, sal_uInt32 nVerSeg, bool bNormals = false, - double fVerStart = F_PI2, double fVerStop = -F_PI2, + double fVerStart = M_PI_2, double fVerStop = -M_PI_2, double fHorStart = 0.0, double fHorStop = F_2PI); /** same as createSpherePolyPolygonFromB3DRange, but creates filled polygons (closed and oriented) @@ -90,7 +90,7 @@ namespace basegfx::utils const B3DRange& rRange, sal_uInt32 nHorSeg, sal_uInt32 nVerSeg, bool bNormals = false, - double fVerStart = F_PI2, double fVerStop = -F_PI2, + double fVerStart = M_PI_2, double fVerStop = -M_PI_2, double fHorStart = 0.0, double fHorStop = F_2PI); /** Create/replace normals for given 3d geometry with default normals from given center to outside. diff --git a/sc/source/core/opencl/opinlinefun_statistical.cxx b/sc/source/core/opencl/opinlinefun_statistical.cxx index dfed055a9b44..6988ff7f03e8 100644 --- a/sc/source/core/opencl/opinlinefun_statistical.cxx +++ b/sc/source/core/opencl/opinlinefun_statistical.cxx @@ -10,7 +10,7 @@ #ifndef SC_OPENCL_OPINLINFUN_statistical #define SC_OPENCL_OPINLINFUN_statistical std::string MinDecl = "#define Min 2.22507e-308\n"; -std::string F_PIDecl="#define F_PI 3.1415926\n"; +std::string F_PIDecl="#define M_PI 3.1415926\n"; std::string fBigInvDecl ="#define fBigInv 2.22045e-016\n"; std::string fMachEpsDecl ="#define fMachEps 2.22045e-016\n"; std::string fLogDblMaxDecl ="#define fLogDblMax log(1.79769e+308)\n"; @@ -406,7 +406,7 @@ std::string GetChiSqDistPDF = " }\n" " else\n" " {\n" -" fValue = pow(sqrt(fX*2*F_PI),-1.0);\n" +" fValue = pow(sqrt(fX*2*M_PI),-1.0);\n" " fCount = 1.0;\n" " }\n" " while ( fCount < fDF)\n" diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx index bd4a37d85742..4e1471c46fbc 100644 --- a/sc/source/core/tool/interpr1.cxx +++ b/sc/source/core/tool/interpr1.cxx @@ -1725,7 +1725,7 @@ void ScInterpreter::ScBitRshift() void ScInterpreter::ScPi() { - PushDouble(F_PI); + PushDouble(M_PI); } void ScInterpreter::ScRandomImpl( const std::function<double( double fFirst, double fLast )>& RandomFunc, @@ -1869,7 +1869,7 @@ void ScInterpreter::ScArcTan() void ScInterpreter::ScArcCot() { - PushDouble((F_PI2) - atan(GetDouble())); + PushDouble((M_PI_2) - atan(GetDouble())); } void ScInterpreter::ScSinHyp() diff --git a/sc/source/core/tool/interpr3.cxx b/sc/source/core/tool/interpr3.cxx index c2c91f621bfd..8d7ba5ea4952 100644 --- a/sc/source/core/tool/interpr3.cxx +++ b/sc/source/core/tool/interpr3.cxx @@ -585,7 +585,7 @@ static double lcl_GetLogGammaHelper(double fZ) /** You must ensure non integer arguments for fZ<1 */ double ScInterpreter::GetGamma(double fZ) { - const double fLogPi = log(F_PI); + const double fLogPi = log(M_PI); const double fLogDblMax = log( ::std::numeric_limits<double>::max()); if (fZ > fMaxGammaArgument) @@ -612,7 +612,7 @@ double ScInterpreter::GetGamma(double fZ) } // fZ<-0.5 // Use Euler's reflection formula: gamma(x)= pi/ ( gamma(1-x)*sin(pi*x) ) - double fLogDivisor = lcl_GetLogGammaHelper(1-fZ) + log( std::abs( ::rtl::math::sin( F_PI*fZ))); + double fLogDivisor = lcl_GetLogGammaHelper(1-fZ) + log( std::abs( ::rtl::math::sin( M_PI*fZ))); if (fLogDivisor - fLogPi >= fLogDblMax) // underflow return 0.0; @@ -623,7 +623,7 @@ double ScInterpreter::GetGamma(double fZ) return HUGE_VAL; } - return exp( fLogPi - fLogDivisor) * ((::rtl::math::sin( F_PI*fZ) < 0.0) ? -1.0 : 1.0); + return exp( fLogPi - fLogDivisor) * ((::rtl::math::sin( M_PI*fZ) < 0.0) ? -1.0 : 1.0); } /** You must ensure fZ>0 */ @@ -709,7 +709,7 @@ double ScInterpreter::GetChiSqDistPDF(double fX, double fDF) } else { - fValue = 1/sqrt(fX*2*F_PI); + fValue = 1/sqrt(fX*2*M_PI); fCount = 1.0; } while ( fCount < fDF) @@ -1610,7 +1610,7 @@ void ScInterpreter::ScStdNormDist_MS() if ( bCumulative ) PushDouble( integralPhi( x ) ); else - PushDouble( exp( - pow( x, 2 ) / 2 ) / sqrt( 2 * F_PI ) ); + PushDouble( exp( - pow( x, 2 ) / 2 ) / sqrt( 2 * M_PI ) ); } void ScInterpreter::ScExpDist() @@ -4849,7 +4849,7 @@ void ScTwiddleFactors::Compute() mfWReal.resize(mnN); mfWImag.resize(mnN); - double nW = (mbInverse ? 2 : -2)*F_PI/static_cast<double>(mnN); + double nW = (mbInverse ? 2 : -2)*M_PI/static_cast<double>(mnN); if (mnN == 1) { @@ -5189,7 +5189,7 @@ void ScComplexBluesteinFFT::Compute() { std::vector<double> aRealScalars(mnPoints); std::vector<double> aImagScalars(mnPoints); - double fW = (mbInverse ? 2 : -2)*F_PI/static_cast<double>(mnPoints); + double fW = (mbInverse ? 2 : -2)*M_PI/static_cast<double>(mnPoints); for (SCSIZE nIdx = 0; nIdx < mnPoints; ++nIdx) { double fAngle = 0.5*fW*static_cast<double>(nIdx*nIdx); diff --git a/sc/source/filter/excel/xeformula.cxx b/sc/source/filter/excel/xeformula.cxx index 982143d877c4..e4e3ec402e89 100644 --- a/sc/source/filter/excel/xeformula.cxx +++ b/sc/source/filter/excel/xeformula.cxx @@ -1453,7 +1453,7 @@ void XclExpFmlaCompImpl::PrepareFunction( const XclExpFuncData& rFuncData ) AppendIntToken( 1 ); break; case ocArcCot: // simulate ACOT(x) by (PI/2-ATAN(x)) - AppendNumToken( F_PI2 ); + AppendNumToken( M_PI_2 ); break; default:; } diff --git a/svgio/source/svgreader/svgtools.cxx b/svgio/source/svgreader/svgtools.cxx index 5d6534db0721..928dfbe5caa9 100644 --- a/svgio/source/svgreader/svgtools.cxx +++ b/svgio/source/svgreader/svgtools.cxx @@ -456,7 +456,7 @@ namespace svgio::svgreader else if (DegreeType::grad == aType) { // looks like 100 grad is 90 degrees - fAngle *= F_PI / 200.0; + fAngle *= M_PI / 200.0; } return true; diff --git a/svx/source/customshapes/EnhancedCustomShape2d.cxx b/svx/source/customshapes/EnhancedCustomShape2d.cxx index ccd15f479b4f..2fb4df76bd1e 100644 --- a/svx/source/customshapes/EnhancedCustomShape2d.cxx +++ b/svx/source/customshapes/EnhancedCustomShape2d.cxx @@ -831,7 +831,7 @@ double EnhancedCustomShape2d::GetEnumFunc( const ExpressionFunct eFunc ) const double fRet = 0.0; switch( eFunc ) { - case ExpressionFunct::EnumPi : fRet = F_PI; break; + case ExpressionFunct::EnumPi : fRet = M_PI; break; case ExpressionFunct::EnumLeft : fRet = static_cast<double>(nCoordLeft); break; case ExpressionFunct::EnumTop : fRet = static_cast<double>(nCoordTop); break; case ExpressionFunct::EnumRight : fRet = (static_cast<double>(nCoordLeft) + static_cast<double>(nCoordWidth)) * fXRatio; break; @@ -1760,8 +1760,8 @@ bool EnhancedCustomShape2d::SetHandleControllerPosition( const sal_uInt32 nIndex if (ftmpX != 0.0 || ftmpY != 0.0) faA = atan2(ftmpY, ftmpX); // range ]-pi..pi], here -pi < faA < -pi/2 // screen 270 deg = mathematic coordinate system -pi/2 - double fha(-F_PI2 - faA); // positive circle angle difference to 270 deg - if (abs(fha) == F_PI2) // should not happen, but ensure no tan(90deg) + double fha(-M_PI_2 - faA); // positive circle angle difference to 270 deg + if (abs(fha) == M_PI_2) // should not happen, but ensure no tan(90deg) fha = 0.12; // dummy value double flFD(2 * std::min(frw, frh) * tan(fha) - fth); if (fss != 0.0) @@ -2477,11 +2477,11 @@ void EnhancedCustomShape2d::CreateSubPath( { if (aEnd.getY()<aStart.getY()) // left, up { - aArc = basegfx::utils::createPolygonFromEllipseSegment(aCenter, fRadiusX, fRadiusY, F_PI2, F_PI); + aArc = basegfx::utils::createPolygonFromEllipseSegment(aCenter, fRadiusX, fRadiusY, M_PI_2, M_PI); } else // left, down { - aArc = basegfx::utils::createPolygonFromEllipseSegment(aCenter, fRadiusX, fRadiusY, F_PI, 1.5*F_PI); + aArc = basegfx::utils::createPolygonFromEllipseSegment(aCenter, fRadiusX, fRadiusY, M_PI, 1.5*M_PI); aArc.flip(); } } @@ -2489,12 +2489,12 @@ void EnhancedCustomShape2d::CreateSubPath( { if (aEnd.getY()<aStart.getY()) // right, up { - aArc = basegfx::utils::createPolygonFromEllipseSegment(aCenter, fRadiusX, fRadiusY, 0.0, F_PI2); + aArc = basegfx::utils::createPolygonFromEllipseSegment(aCenter, fRadiusX, fRadiusY, 0.0, M_PI_2); aArc.flip(); } else // right, down { - aArc = basegfx::utils::createPolygonFromEllipseSegment(aCenter, fRadiusX, fRadiusY, 1.5*F_PI, F_2PI); + aArc = basegfx::utils::createPolygonFromEllipseSegment(aCenter, fRadiusX, fRadiusY, 1.5*M_PI, F_2PI); } } } @@ -2505,23 +2505,23 @@ void EnhancedCustomShape2d::CreateSubPath( { if (aEnd.getY()<aStart.getY()) // up, left { - aArc = basegfx::utils::createPolygonFromEllipseSegment(aCenter, fRadiusX, fRadiusY, 1.5*F_PI, F_2PI); + aArc = basegfx::utils::createPolygonFromEllipseSegment(aCenter, fRadiusX, fRadiusY, 1.5*M_PI, F_2PI); aArc.flip(); } else // down, left { - aArc = basegfx::utils::createPolygonFromEllipseSegment(aCenter, fRadiusX, fRadiusY, 0.0, F_PI2); + aArc = basegfx::utils::createPolygonFromEllipseSegment(aCenter, fRadiusX, fRadiusY, 0.0, M_PI_2); } } else // aEnd.getX()>=aStart.getX() { if (aEnd.getY()<aStart.getY()) // up, right { - aArc = basegfx::utils::createPolygonFromEllipseSegment(aCenter, fRadiusX, fRadiusY, F_PI, 1.5*F_PI); + aArc = basegfx::utils::createPolygonFromEllipseSegment(aCenter, fRadiusX, fRadiusY, M_PI, 1.5*M_PI); } else // down, right { - aArc = basegfx::utils::createPolygonFromEllipseSegment(aCenter, fRadiusX, fRadiusY, F_PI2, F_PI); + aArc = basegfx::utils::createPolygonFromEllipseSegment(aCenter, fRadiusX, fRadiusY, M_PI_2, M_PI); aArc.flip(); } } diff --git a/svx/source/dialog/dlgctl3d.cxx b/svx/source/dialog/dlgctl3d.cxx index d2aab7f954d7..504e65e6c7a6 100644 --- a/svx/source/dialog/dlgctl3d.cxx +++ b/svx/source/dialog/dlgctl3d.cxx @@ -299,7 +299,7 @@ void Svx3DLightControl::Construct2() basegfx::B3DPolygon a3DCircle(basegfx::utils::createB3DPolygonFromB2DPolygon(a2DCircle)); basegfx::B3DHomMatrix aTransform; - aTransform.rotate(F_PI2, 0.0, 0.0); + aTransform.rotate(M_PI_2, 0.0, 0.0); aTransform.translate(0.0, -RADIUS_LAMP_PREVIEW_SIZE, 0.0); a3DCircle.transform(aTransform); @@ -314,7 +314,7 @@ void Svx3DLightControl::Construct2() a2DHalfCircle.append(basegfx::B2DPoint(RADIUS_LAMP_PREVIEW_SIZE, 0.0)); a2DHalfCircle.append(basegfx::B2DPoint(RADIUS_LAMP_PREVIEW_SIZE, -RADIUS_LAMP_PREVIEW_SIZE)); a2DHalfCircle.append(basegfx::utils::createPolygonFromEllipseSegment( - basegfx::B2DPoint(0.0, 0.0), RADIUS_LAMP_PREVIEW_SIZE, RADIUS_LAMP_PREVIEW_SIZE, F_2PI - F_PI2, F_PI2)); + basegfx::B2DPoint(0.0, 0.0), RADIUS_LAMP_PREVIEW_SIZE, RADIUS_LAMP_PREVIEW_SIZE, F_2PI - M_PI_2, M_PI_2)); basegfx::B3DPolygon a3DHalfCircle(basegfx::utils::createB3DPolygonFromB2DPolygon(a2DHalfCircle)); // create object for it @@ -609,14 +609,14 @@ bool Svx3DLightControl::MouseMove(const MouseEvent& rMEvt) } // cut vertical - if(fNewRotX < -F_PI2) + if(fNewRotX < -M_PI_2) { - fNewRotX = -F_PI2; + fNewRotX = -M_PI_2; } - if(fNewRotX > F_PI2) + if(fNewRotX > M_PI_2) { - fNewRotX = F_PI2; + fNewRotX = M_PI_2; } SetRotation(fNewRotX, fNewRotY, mfSaveActionStartRotZ); @@ -712,7 +712,7 @@ void Svx3DLightControl::GetPosition(double& rHor, double& rVer) { basegfx::B3DVector aDirection(GetLightDirection(maSelectedLight)); aDirection.normalize(); - rHor = basegfx::rad2deg(atan2(-aDirection.getX(), -aDirection.getZ()) + F_PI); // 0..360.0 + rHor = basegfx::rad2deg(atan2(-aDirection.getX(), -aDirection.getZ()) + M_PI); // 0..360.0 rVer = basegfx::rad2deg(atan2(aDirection.getY(), aDirection.getXZLength())); // -90.0..90.0 } if(IsGeometrySelected()) @@ -727,7 +727,7 @@ void Svx3DLightControl::SetPosition(double fHor, double fVer) if(IsSelectionValid()) { // set selected light's direction - fHor = basegfx::deg2rad(fHor) - F_PI; // -PI..PI + fHor = basegfx::deg2rad(fHor) - M_PI; // -PI..PI fVer = basegfx::deg2rad(fVer); // -PI2..PI2 basegfx::B3DVector aDirection(cos(fVer) * -sin(fHor), sin(fVer), cos(fVer) * -cos(fHor)); aDirection.normalize(); diff --git a/svx/source/dialog/frmsel.cxx b/svx/source/dialog/frmsel.cxx index 7871ae95249a..b2ab3d7ce523 100644 --- a/svx/source/dialog/frmsel.cxx +++ b/svx/source/dialog/frmsel.cxx @@ -425,7 +425,7 @@ void FrameSelectorImpl::InitBorderGeometry() basegfx::fround(aCellRange.getMinX()), basegfx::fround(aCellRange.getMinY()), basegfx::fround(aCellRange.getMaxX()), basegfx::fround(aCellRange.getMaxY())); const double fHorDiagAngle(atan2(fabs(aCellRange.getHeight()), fabs(aCellRange.getWidth()))); - const double fVerDiagAngle(fHorDiagAngle > 0.0 ? F_PI2 - fHorDiagAngle : 0.0); + const double fVerDiagAngle(fHorDiagAngle > 0.0 ? M_PI_2 - fHorDiagAngle : 0.0); const tools::Long nDiagFocusOffsX(basegfx::fround(-mnFocusOffs / tan(fHorDiagAngle) + mnFocusOffs / sin(fHorDiagAngle))); const tools::Long nDiagFocusOffsY(basegfx::fround(-mnFocusOffs / tan(fVerDiagAngle) + mnFocusOffs / sin(fVerDiagAngle))); diff --git a/svx/source/engine3d/view3d.cxx b/svx/source/engine3d/view3d.cxx index bf693bce10d1..8f339f5b747e 100644 --- a/svx/source/engine3d/view3d.cxx +++ b/svx/source/engine3d/view3d.cxx @@ -864,7 +864,7 @@ void E3dView::ConvertMarkedObjTo3D(bool bExtrude, const basegfx::B2DPoint& rPnt1 // Rotation around control point #1 with set angle // for 3D coordinates basegfx::B2DPoint aDiff(rPnt1 - rPnt2); - fRot3D = atan2(aDiff.getY(), aDiff.getX()) - F_PI2; + fRot3D = atan2(aDiff.getY(), aDiff.getX()) - M_PI_2; if(basegfx::fTools::equalZero(fabs(fRot3D))) fRot3D = 0.0; diff --git a/svx/source/sdr/contact/viewcontactofe3dlathe.cxx b/svx/source/sdr/contact/viewcontactofe3dlathe.cxx index 4cf299259c4f..0d9d0714aa56 100644 --- a/svx/source/sdr/contact/viewcontactofe3dlathe.cxx +++ b/svx/source/sdr/contact/viewcontactofe3dlathe.cxx @@ -64,7 +64,7 @@ namespace sdr::contact const basegfx::B2DRange aPolyPolygonRange(basegfx::utils::getRange(aPolyPolygon)); const basegfx::B2DVector aTextureSize( - F_PI * fabs(aPolyPolygonRange.getCenter().getX()), // PI * d + M_PI * fabs(aPolyPolygonRange.getCenter().getX()), // PI * d fPolygonMaxLength); // get more data @@ -72,7 +72,7 @@ namespace sdr::contact const sal_uInt32 nVerticalSegments(GetE3dLatheObj().GetVerticalSegments()); const double fDiagonal(static_cast<double>(GetE3dLatheObj().GetPercentDiagonal()) / 100.0); const double fBackScale(static_cast<double>(GetE3dLatheObj().GetBackScale()) / 100.0); - const double fRotation((static_cast<double>(GetE3dLatheObj().GetEndAngle()) / 1800.0) * F_PI); + const double fRotation((static_cast<double>(GetE3dLatheObj().GetEndAngle()) / 1800.0) * M_PI); const bool bSmoothNormals(GetE3dLatheObj().GetSmoothNormals()); // Plane itself const bool bSmoothLids(GetE3dLatheObj().GetSmoothLids()); // Front/back const bool bCharacterMode(GetE3dLatheObj().GetCharacterMode()); diff --git a/svx/source/sdr/contact/viewcontactofe3dsphere.cxx b/svx/source/sdr/contact/viewcontactofe3dsphere.cxx index 671a5b670297..e77d7a43e15f 100644 --- a/svx/source/sdr/contact/viewcontactofe3dsphere.cxx +++ b/svx/source/sdr/contact/viewcontactofe3dsphere.cxx @@ -63,8 +63,8 @@ namespace sdr::contact // calculate texture size, use radii for (2 * PI * r) to get a perfect // mapping on the sphere const basegfx::B2DVector aTextureSize( - F_PI * ((aSphereSize.getX() + aSphereSize.getZ()) / 2.0), // PI * d - F_PI2 * aSphereSize.getY()); // half outline, (PI * d)/2 -> PI/2 * d + M_PI * ((aSphereSize.getX() + aSphereSize.getZ()) / 2.0), // PI * d + M_PI_2 * aSphereSize.getY()); // half outline, (PI * d)/2 -> PI/2 * d // create primitive and add const drawinglayer::primitive3d::Primitive3DReference xReference( diff --git a/svx/source/sdr/contact/viewcontactofsdrobjcustomshape.cxx b/svx/source/sdr/contact/viewcontactofsdrobjcustomshape.cxx index a28e06f589e3..6a4e22ec7af0 100644 --- a/svx/source/sdr/contact/viewcontactofsdrobjcustomshape.cxx +++ b/svx/source/sdr/contact/viewcontactofsdrobjcustomshape.cxx @@ -94,7 +94,7 @@ namespace sdr::contact if(GetCustomShapeObj().IsMirroredY()) { basegfx::B2DHomMatrix aRotMatrix(basegfx::utils::createRotateAroundPoint( - aObjectRange.getCenterX(), aObjectRange.getCenterY(), F_PI)); + aObjectRange.getCenterX(), aObjectRange.getCenterY(), M_PI)); aTextRange.transform(aRotMatrix); } } diff --git a/svx/source/sdr/primitive2d/sdrframeborderprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrframeborderprimitive2d.cxx index 8b40bc78fab3..448640591ce6 100644 --- a/svx/source/sdr/primitive2d/sdrframeborderprimitive2d.cxx +++ b/svx/source/sdr/primitive2d/sdrframeborderprimitive2d.cxx @@ -209,8 +209,8 @@ namespace return; // create angle between both. angle() needs vectors pointing away from the same point, - // so take the mirrored one. Add F_PI to get from -pi..+pi to [0..F_PI2] for sorting - const double fAngle(basegfx::B2DVector(-rMyVector.getX(), -rMyVector.getY()).angle(rOtherVector) + F_PI); + // so take the mirrored one. Add M_PI to get from -pi..+pi to [0..M_PI_2] for sorting + const double fAngle(basegfx::B2DVector(-rMyVector.getX(), -rMyVector.getY()).angle(rOtherVector) + M_PI); maEntries.emplace_back( rStyle, rOtherVector, @@ -433,7 +433,7 @@ namespace { // sort: min to start, max to end std::sort(aCutSets.begin(), aCutSets.end()); - const bool bOtherUpper(rStyleCandidate.getAngle() > F_PI); + const bool bOtherUpper(rStyleCandidate.getAngle() > M_PI); // check if we need min or max // bUpper bOtherUpper MinMax diff --git a/svx/source/sdr/primitive2d/sdrmeasureprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrmeasureprimitive2d.cxx index aba7bf008fd6..32ad5764db7e 100644 --- a/svx/source/sdr/primitive2d/sdrmeasureprimitive2d.cxx +++ b/svx/source/sdr/primitive2d/sdrmeasureprimitive2d.cxx @@ -100,10 +100,10 @@ namespace drawinglayer::primitive2d if(getTextRotation()) { - aTextMatrix.rotate(-F_PI2); - fTestAngle -= (F_PI2); + aTextMatrix.rotate(-M_PI_2); + fTestAngle -= (M_PI_2); - if(getTextAutoAngle() && fTestAngle < -F_PI) + if(getTextAutoAngle() && fTestAngle < -M_PI) { fTestAngle += F_2PI; } @@ -111,7 +111,7 @@ namespace drawinglayer::primitive2d if(getTextAutoAngle()) { - if(fTestAngle > (F_PI / 4.0) || fTestAngle < (-F_PI * (3.0 / 4.0))) + if(fTestAngle > (M_PI / 4.0) || fTestAngle < (-M_PI * (3.0 / 4.0))) { bAutoUpsideDown = true; } @@ -403,7 +403,7 @@ namespace drawinglayer::primitive2d // handle auto text rotation if(bAutoUpsideDown) { - aChange.rotate(F_PI); + aChange.rotate(M_PI); } // move from aTextRange.TopLeft to fTextX, fTextY diff --git a/svx/source/svdraw/svdhdl.cxx b/svx/source/svdraw/svdhdl.cxx index c509a069f715..d0c61f808ef3 100644 --- a/svx/source/svdraw/svdhdl.cxx +++ b/svx/source/svdraw/svdhdl.cxx @@ -2488,7 +2488,7 @@ void translateRotationToMirroring(basegfx::B2DVector & scale, double * rotate) { // with getSmallValue here, the original which uses rtl::math::approxEqual // is too correct here. Maybe this changes with enhanced precision in aw080 // to the better so that this can be reduced to the more precise call again - if(basegfx::fTools::equal(fabs(*rotate), F_PI, 0.000000001)) + if(basegfx::fTools::equal(fabs(*rotate), M_PI, 0.000000001)) { scale.setX(scale.getX() * -1.0); scale.setY(scale.getY() * -1.0); diff --git a/svx/source/svdraw/svdocapt.cxx b/svx/source/svdraw/svdocapt.cxx index 9e811de8bf4e..54889a9dde28 100644 --- a/svx/source/svdraw/svdocapt.cxx +++ b/svx/source/svdraw/svdocapt.cxx @@ -710,7 +710,7 @@ void handleNegativeScale(basegfx::B2DTuple & scale, double * rotate) { { scale.setX(fabs(scale.getX())); scale.setY(fabs(scale.getY())); - *rotate = fmod(*rotate + F_PI, F_2PI); + *rotate = fmod(*rotate + M_PI, F_2PI); } } diff --git a/svx/source/svdraw/svdocirc.cxx b/svx/source/svdraw/svdocirc.cxx index 9dc3a1d2d812..4275daa86187 100644 --- a/svx/source/svdraw/svdocirc.cxx +++ b/svx/source/svdraw/svdocirc.cxx @@ -262,8 +262,8 @@ basegfx::B2DPolygon SdrCircObj::ImpCalcXPolyCirc(const SdrCircKind eCircleKind, { // mirror start, end for geometry creation since model coordinate system is mirrored in Y // #i111715# increase numerical correctness by first dividing and not using F_PI1800 - const double fStart((((36000 - nEnd.get()) % 36000) / 18000.0) * F_PI); - const double fEnd((((36000 - nStart.get()) % 36000) / 18000.0) * F_PI); + const double fStart((((36000 - nEnd.get()) % 36000) / 18000.0) * M_PI); + const double fEnd((((36000 - nStart.get()) % 36000) / 18000.0) * M_PI); // create circle segment. This is not closed by default aCircPolygon = basegfx::utils::createPolygonFromEllipseSegment( diff --git a/svx/source/svdraw/svdopath.cxx b/svx/source/svdraw/svdopath.cxx index 33845217c79d..17cf7f4a431e 100644 --- a/svx/source/svdraw/svdopath.cxx +++ b/svx/source/svdraw/svdopath.cxx @@ -2907,7 +2907,7 @@ void SdrPathObj::TRSetBaseGeometry(const basegfx::B2DHomMatrix& rMatrix, const b { aScale.setX(fabs(aScale.getX())); aScale.setY(fabs(aScale.getY())); - fRotate = fmod(fRotate + F_PI, F_2PI); + fRotate = fmod(fRotate + M_PI, F_2PI); } // copy poly diff --git a/sw/source/core/bastyp/calc.cxx b/sw/source/core/bastyp/calc.cxx index 983e4f6eb0fa..7ea6de6cb00c 100644 --- a/sw/source/core/bastyp/calc.cxx +++ b/sw/source/core/bastyp/calc.cxx @@ -323,7 +323,7 @@ SwCalc::SwCalc( SwDoc& rD ) m_aVarTable[ aHashValue[ 0 ] ]->nValue.PutBool( false ); m_aVarTable[ aHashValue[ 1 ] ]->nValue.PutBool( true ); - m_aVarTable[ aHashValue[ 2 ] ]->nValue.PutDouble( F_PI ); + m_aVarTable[ aHashValue[ 2 ] ]->nValue.PutDouble( M_PI ); m_aVarTable[ aHashValue[ 3 ] ]->nValue.PutDouble( 2.7182818284590452354 ); for( n = 0; n < 3; ++n ) diff --git a/sw/source/uibase/docvw/ShadowOverlayObject.cxx b/sw/source/uibase/docvw/ShadowOverlayObject.cxx index 8cdae0a60dfe..7607cb3354d0 100644 --- a/sw/source/uibase/docvw/ShadowOverlayObject.cxx +++ b/sw/source/uibase/docvw/ShadowOverlayObject.cxx @@ -87,7 +87,7 @@ void ShadowPrimitive::create2DDecomposition( 0.0, 0.5, 0.5, - F_PI, + M_PI, basegfx::BColor(230.0/255.0,230.0/255.0,230.0/255.0), basegfx::BColor(180.0/255.0,180.0/255.0,180.0/255.0)); @@ -105,7 +105,7 @@ void ShadowPrimitive::create2DDecomposition( 0.0, 0.5, 0.5, - F_PI, + M_PI, basegfx::BColor(230.0/255.0,230.0/255.0,230.0/255.0), basegfx::BColor(180.0/255.0,180.0/255.0,180.0/255.0)); @@ -123,7 +123,7 @@ void ShadowPrimitive::create2DDecomposition( 0.0, 0.5, 0.5, - F_PI, + M_PI, basegfx::BColor(230.0/255.0,230.0/255.0,230.0/255.0), basegfx::BColor(83.0/255.0,83.0/255.0,83.0/255.0)); diff --git a/tools/source/generic/poly.cxx b/tools/source/generic/poly.cxx index 7c5eca59d4c0..8be16bbd5ebd 100644 --- a/tools/source/generic/poly.cxx +++ b/tools/source/generic/poly.cxx @@ -180,7 +180,7 @@ ImplPolygon::ImplPolygon( const Point& rCenter, tools::Long nRadX, tools::Long n if (!bOverflow) { nPoints = static_cast<sal_uInt16>(MinMax( - ( F_PI * ( 1.5 * ( nRadX + nRadY ) - + ( M_PI * ( 1.5 * ( nRadX + nRadY ) - sqrt( static_cast<double>(std::abs(nRadXY)) ) ) ), 32, 256 )); } @@ -200,7 +200,7 @@ ImplPolygon::ImplPolygon( const Point& rCenter, tools::Long nRadX, tools::Long n sal_uInt16 nPoints2 = nPoints >> 1; sal_uInt16 nPoints4 = nPoints >> 2; double nAngle; - double nAngleStep = F_PI2 / ( nPoints4 - 1 ); + double nAngleStep = M_PI_2 / ( nPoints4 - 1 ); for( i=0, nAngle = 0.0; i < nPoints4; i++, nAngle += nAngleStep ) { @@ -246,7 +246,7 @@ ImplPolygon::ImplPolygon( const tools::Rectangle& rBound, const Point& rStart, c if (!bOverflow) { nPoints = static_cast<sal_uInt16>(MinMax( - ( F_PI * ( 1.5 * ( nRadX + nRadY ) - + ( M_PI * ( 1.5 * ( nRadX + nRadY ) - sqrt( static_cast<double>(std::abs(nRadXY)) ) ) ), 32, 256 )); } diff --git a/vcl/source/bitmap/BitmapEx.cxx b/vcl/source/bitmap/BitmapEx.cxx index 187b9290738e..d2c52c47a746 100644 --- a/vcl/source/bitmap/BitmapEx.cxx +++ b/vcl/source/bitmap/BitmapEx.cxx @@ -733,9 +733,9 @@ namespace fRotate += F_2PI; } if (!rtl::math::approxEqual(fRotate, 0) - && !rtl::math::approxEqual(fRotate, F_PI2) - && !rtl::math::approxEqual(fRotate, F_PI) - && !rtl::math::approxEqual(fRotate, 3 * F_PI2)) + && !rtl::math::approxEqual(fRotate, M_PI_2) + && !rtl::math::approxEqual(fRotate, M_PI) + && !rtl::math::approxEqual(fRotate, 3 * M_PI_2)) { return true; } diff --git a/xmloff/source/text/txtparae.cxx b/xmloff/source/text/txtparae.cxx index c6c8dca09f60..322a5e2128e3 100644 --- a/xmloff/source/text/txtparae.cxx +++ b/xmloff/source/text/txtparae.cxx @@ -3080,7 +3080,7 @@ void XMLTextParagraphExport::_exportTextGraphic( // in XMLTextFrameContext_Impl::XMLTextFrameContext_Impl and #i78696# // CAUTION-II: due to tdf#115782 it is better for current ODF to indeed write it with the wrong // orientation as in all other cases - ARGH! We will need to correct this in future ODF ASAP! - const double fRotate(static_cast< double >(nRotation) * (F_PI/1800.0)); + const double fRotate(static_cast< double >(nRotation) * (M_PI/1800.0)); // transform to rotation center which is the object's center aSdXMLImExTransform2D.AddTranslate(-aCenter); |