Skip to content

Commit

Permalink
fix nan in detected photon data when using hyperboloid src, see https…
Browse files Browse the repository at this point in the history
  • Loading branch information
fangq committed Oct 5, 2022
1 parent 10330ef commit 63ffc1e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/mcx_core.cu
Original file line number Diff line number Diff line change
Expand Up @@ -1295,7 +1295,7 @@ __device__ inline int launchnewphoton(MCXpos* p, MCXdir* v, Stokes* s, MCXtime*
float phi = TWO_PI * rand_uniform01(t);
sincosf(phi, &sphi, &cphi);

float r = sqrtf(-0.5f * logf(rand_uniform01(t))) * gcfg->srcparam1.x;
float r = sqrtf(0.5f * rand_next_scatlen(t)) * gcfg->srcparam1.x;

/** parameter to generate photon path from coordinates at focus (depends on focal distance and rayleigh range) */
float tt = -gcfg->srcparam1.y / gcfg->srcparam1.z;
Expand Down

0 comments on commit 63ffc1e

Please sign in to comment.