Skip to content

Commit 650ac95

Browse files
prybickimsz-rai
andauthored
Remove M_PIf to enable compilation on Windows (#272)
* Remove M_PIf to enable compilation on Windows * Update test/src/scene/rcsAngleDistributionTest.cpp Co-authored-by: Mateusz Szczygielski <[email protected]> --------- Co-authored-by: Mateusz Szczygielski <[email protected]>
1 parent 5317f9d commit 650ac95

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/gpu/nodeKernels.cu

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ __global__ void kRadarComputeEnergy(size_t count, float rayAzimuthStepRad, float
105105
constexpr float c0 = 299792458.0f;
106106
constexpr float reflectionCoef = 1.0f; // TODO
107107
const float waveLen = c0 / freq;
108-
const float waveNum = 2.0f * M_PIf / waveLen;
108+
const float waveNum = 2.0f * static_cast<float>(M_PI) / waveLen;
109109
const thrust::complex<float> i = {0, 1.0};
110110
const Vec3f dirX = {1, 0, 0};
111111
const Vec3f dirY = {0, 1, 0};
@@ -142,7 +142,7 @@ __global__ void kRadarComputeEnergy(size_t count, float rayAzimuthStepRad, float
142142

143143
thrust::complex<float> BU = (-(apE.cross(-dirP) + apH.cross(dirT))).dot(rayDir);
144144
thrust::complex<float> BR = (-(apE.cross(dirT) + apH.cross(dirP))).dot(rayDir);
145-
thrust::complex<float> factor = thrust::complex<float>(0.0, ((waveNum * rayArea) / (4.0f * M_PIf))) *
145+
thrust::complex<float> factor = thrust::complex<float>(0.0, ((waveNum * rayArea) / (4.0f * static_cast<float>(M_PI)))) *
146146
exp(-i * vecK.dot(hitPos[tid]));
147147

148148
// printf("GPU: point=%d ray=??: dist=%f, pos=(%.2f, %.2f, %.2f), norm=(%.2f, %.2f, %.2f), BU=(%.2f+%.2fi), BR=(%.2f+%.2fi), factor=(%.2f+%.2fi)\n", tid, hitDist[tid],

test/src/scene/rcsAngleDistributionTest.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ const auto minElevation = -7.5f;
2424
const auto maxElevation = 7.5f;
2525
const auto azimuthStep = 0.05f;
2626
const auto elevationStep = 0.05f;
27-
const auto azimuthRad = (maxAzimuth - minAzimuth) * M_PIf / 180.0f;
28-
const auto elevationRad = (maxElevation - minElevation) * M_PIf / 180.0f;
27+
const auto azimuthRad = (maxAzimuth - minAzimuth) * std::numbers::pi_v<float> / 180.0f;
28+
const auto elevationRad = (maxElevation - minElevation) * std::numbers::pi_v<float> / 180.0f;
2929

3030
std::vector<rgl_mat3x4f> genRadarRays()
3131
{

0 commit comments

Comments
 (0)