Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@
#include <Eigen/Eigenvalues>

#include <array>
#include <cmath>
#include <numbers>
#include <utility>

namespace
{
/**
Expand Down Expand Up @@ -272,7 +273,7 @@ void ComputeShapes::findMoments()
}
}
}
double sphere = (2000.0 * M_PI * M_PI) / 9.0;
double sphere = (2000.0 * std::numbers::pi * std::numbers::pi) / 9.0;
// constant for moments because voxels are broken into smaller voxels
double konst1 = static_cast<double>((modXRes / 2.0) * (modYRes / 2.0) * (modZRes / 2.0));
// constant for volumes because voxels are counted as one
Expand Down Expand Up @@ -451,7 +452,7 @@ void ComputeShapes::findAxes()
const auto& centroids = m_DataStructure.getDataRefAs<Float32Array>(m_InputValues->CentroidsArrayPath);

size_t numfeatures = centroids.getNumberOfTuples();
constexpr double multiplier = 1.0 / (4.0 * M_PI);
constexpr double multiplier = 1.0 / (4.0 * std::numbers::pi);
for(size_t featureId = 1; featureId < numfeatures; featureId++)
{
double r1 = m_FeatureEigenVals[3 * featureId];
Expand Down Expand Up @@ -515,7 +516,7 @@ void ComputeShapes::findAxes2D()
spacing = imageGeom.getSpacing();
}

double preterm = 4.0 / M_PI;
double preterm = 4.0 / std::numbers::pi;
preterm = std::pow(preterm, 0.25);

for(size_t i = 1; i < numfeatures; i++)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include <EbsdLib/Orientation/OrientationFwd.hpp>
#include <EbsdLib/Orientation/OrientationMatrix.hpp>

#include <numbers>
#include <unordered_set>

using namespace nx::core;
Expand Down Expand Up @@ -258,7 +259,7 @@ class ComputeShapesTriangleGeomImpl

// Theoretical perfect Sphere value of Omega-3. Each calculated Omega-3
// will be normalized using this value;
constexpr float64 k_Sphere = (2000.0 * M_PI * M_PI) / 9.0;
constexpr float64 k_Sphere = (2000.0 * std::numbers::pi * std::numbers::pi) / 9.0;

// define the canonical cMatrix matrix
constexpr float64 aVal = 1.0 / 60.0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ nx::core::Result<> LoadEbsdData(const nx::core::ReadH5EbsdInputValues* mInputVal

if(selectedArrayNames.find(ebsdlib::CellData::EulerAngles) != selectedArrayNames.end())
{
// radian conversion = M_PI / 180.0;
// radian conversion = std::numbers::pi / 180.0;
auto* euler0 = reinterpret_cast<float*>(ebsdReader->getPointerByName(eulerNames[0]));
auto* euler1 = reinterpret_cast<float*>(ebsdReader->getPointerByName(eulerNames[1]));
auto* euler2 = reinterpret_cast<float*>(ebsdReader->getPointerByName(eulerNames[2]));
Expand Down
Loading