Skip to content
This repository has been archived by the owner on Dec 9, 2024. It is now read-only.

Commit

Permalink
add protection on phi_mpi_pi
Browse files Browse the repository at this point in the history
  • Loading branch information
YonsiG committed Jul 7, 2023
1 parent 58b9bd3 commit 32c54ff
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion SDL/Hit.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ namespace SDL
return x - n * float(2.f * float(M_PI));
}
CUDA_HOSTDEV inline float phi(float x, float y) {
return atan2f(y,x);
return phi_mpi_pi(float(M_PI) + atan2f(y,x));
}
CUDA_HOSTDEV inline float deltaPhi(float x1, float y1, float x2, float y2) {
float phi1 = phi(x1,y1);
Expand Down

0 comments on commit 32c54ff

Please sign in to comment.