Skip to content

Commit

Permalink
fix: rename variable to avoid confusion
Browse files Browse the repository at this point in the history
  • Loading branch information
ShijieYan committed Oct 12, 2021
1 parent 0f15971 commit 3f904e7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/mcx_core.cu
Original file line number Diff line number Diff line change
Expand Up @@ -1213,11 +1213,11 @@ __device__ inline int launchnewphoton(MCXpos *p,MCXdir *v,MCXtime *f,float3* rv,
float r=sqrtf(-0.5f*logf(rand_uniform01(t)))*gcfg->srcparam1.x;

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

/** if beam direction is along +z or -z direction */
float3 pd=float3(r*(cphi-t*sphi), r*(sphi+t*cphi), 0.f); // position displacement from srcpos
float3 pd=float3(r*(cphi-tt*sphi), r*(sphi+tt*cphi), 0.f); // position displacement from srcpos
float3 v0=float3(-r*sphi*l, r*cphi*l, gcfg->srcparam1.z*l); // photon dir. w.r.t the beam dir. v

/** if beam dir. is not +z or -z, compute photon position and direction after rotation */
Expand Down

0 comments on commit 3f904e7

Please sign in to comment.